Skip to content

Commit b1ff1bc

Browse files
committed
Make laravel-gettext work with symfony-translate 6.0
1 parent 170636b commit b1ff1bc

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"phpunit/phpunit": "~7.0 || ^8.5 || ^9",
3838
"squizlabs/php_codesniffer" : "1.5.*",
3939
"laravel/laravel": "^6.0 || ^7.0 || ^8.0",
40-
"php-coveralls/php-coveralls": "^2.1"
40+
"php-coveralls/php-coveralls": "^2.1",
41+
"symfony/translation": "^6.0"
4142
},
4243
"autoload": {
4344
"psr-0": {

src/deepskylog/LaravelGettext/FileLoader/Cache/ApcuFileCacheLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(FileLoader $underlyingFileLoader)
3535
*
3636
* @throws InvalidResourceException if stream content has an invalid format
3737
*/
38-
protected function loadResource($resource)
38+
protected function loadResource(string $resource): array
3939
{
4040
if (!extension_loaded('apcu')) {
4141
return $this->underlyingFileLoader->loadResource($resource);

src/deepskylog/LaravelGettext/FileLoader/MoFileLoader.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,30 @@ class MoFileLoader extends FileLoader
1616
*
1717
* @var float
1818
*/
19-
const MO_LITTLE_ENDIAN_MAGIC = 0x950412de;
19+
public const MO_LITTLE_ENDIAN_MAGIC = 0x950412de;
2020

2121
/**
2222
* Magic used for validating the format of a MO file as well as
2323
* detecting if the machine used to create that file was big endian.
2424
*
2525
* @var float
2626
*/
27-
const MO_BIG_ENDIAN_MAGIC = 0xde120495;
27+
public const MO_BIG_ENDIAN_MAGIC = 0xde120495;
2828

2929
/**
3030
* The size of the header of a MO file in bytes.
3131
*
3232
* @var int Number of bytes
3333
*/
34-
const MO_HEADER_SIZE = 28;
34+
public const MO_HEADER_SIZE = 28;
3535

3636
/**
3737
* Parses machine object (MO) format, independent of the machine's endian it
3838
* was created on. Both 32bit and 64bit systems are supported.
3939
*
4040
* {@inheritdoc}
4141
*/
42-
protected function loadResource($resource)
42+
protected function loadResource(string $resource): array
4343
{
4444
$stream = fopen($resource, 'r');
4545

0 commit comments

Comments
 (0)