Skip to content

Commit 720ddcc

Browse files
committed
feat: #20230407 支持PHP8.3
1 parent 5b597fb commit 720ddcc

File tree

9 files changed

+27
-15
lines changed

9 files changed

+27
-15
lines changed

Command/PluginCreateCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
125125
}
126126

127127
$output->writeln("<info>Finished!</info>\n");
128+
129+
return 0;
128130
}
129131

130132
/**

Command/PluginRegisterCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8686
$output->writeln($content);
8787

8888
$output->writeln("<info>Finished!</info>\n");
89+
90+
return 0;
8991
}
9092
}

Command/PluginRemoveCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
5757
$output->writeln('<info>[Ok]</info>');
5858

5959
$output->writeln("<info>Finished!</info>\n");
60+
61+
return 0;
6062
}
6163
}

System/PluginRegister.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function installAssets($code)
9191
$console = escapeshellarg($consoleDir.'/console');
9292
$cmd = 'assets:install --symlink --relative web';
9393

94-
$process = new Process($php.($phpArgs ? ' '.$phpArgs : '').' '.$console.' '.$cmd);
94+
$process = Process::fromShellCommandline($php.($phpArgs ? ' '.$phpArgs : '').' '.$console.' '.$cmd);
9595
$process->mustRun();
9696

9797
return $process->getOutput();

Tests/DependencyInjection/Compiler/EventSubscriberPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function testEventSubscriberWithoutInterface()
1414
];
1515
$definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
1616

17-
$builder = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(['findTaggedServiceIds', 'getDefinition'])->getMock();
17+
$builder = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->onlyMethods(['findTaggedServiceIds', 'getDefinition'])->getMock();
1818

1919
$builder->expects($this->atLeastOnce())
2020
->method('findTaggedServiceIds')

Tests/Loader/Fixture/TestKernel.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ public function registerBundles(): iterable
1919
return $bundles;
2020
}
2121

22+
public function getRootDir()
23+
{
24+
return $this->getProjectDir() . '/app';
25+
}
26+
2227
public function registerContainerConfiguration(LoaderInterface $loader)
2328
{
2429
$loader->load(__DIR__.'/app/config/config.yml');

Tests/Loader/ThemeTwigLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ private function mockKernel()
3131
{
3232
$testKernel = $this->getMockBuilder('Codeages\PluginBundle\Tests\Loader\Fixture\TestKernel')
3333
->setConstructorArgs(['test', true])
34-
->setMethods(['getPluginConfigurationManager', 'getRootDir'])
34+
->onlyMethods(['getPluginConfigurationManager', 'getRootDir'])
3535
->getMockForAbstractClass();
3636

3737
$testKernel->method('getRootDir')->willReturn(__DIR__.DIRECTORY_SEPARATOR.'Fixture'.DIRECTORY_SEPARATOR.'app');
3838

3939
$pluginConfigurationManager = $this->getMockBuilder('Codeages\PluginBundle\System\PluginConfigurationManager')
4040
->setConstructorArgs([__DIR__.DIRECTORY_SEPARATOR.'Fixture'.DIRECTORY_SEPARATOR.'app'])
41-
->setMethods(['getActiveThemeDirectory', 'getActiveThemeName'])
41+
->onlyMethods(['getActiveThemeDirectory', 'getActiveThemeName'])
4242
->getMock();
4343

4444
$pluginConfigurationManager

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"symfony/framework-bundle": "^5.4.35",
2222
"symfony/yaml": "^5.4.35",
2323
"symfony/config": "^5.4.35",
24+
"symfony/process": "^5.4.35",
2425
"codeages/biz-framework": "^0.12"
2526
},
2627
"require-dev": {

phpunit.xml.dist

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./Tests/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3-
<coverage>
4-
<include>
5-
<directory>./</directory>
6-
</include>
7-
<exclude>
8-
<directory>./Resources</directory>
9-
<directory>./Tests</directory>
10-
<directory>./vendor</directory>
11-
</exclude>
12-
</coverage>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./Tests/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd">
133
<php>
144
<server name="KERNEL_DIR" value="Tests/app"/>
155
</php>
@@ -18,4 +8,14 @@
188
<directory suffix="Test.php">./Tests</directory>
199
</testsuite>
2010
</testsuites>
11+
<source>
12+
<include>
13+
<directory>./</directory>
14+
</include>
15+
<exclude>
16+
<directory>./Resources</directory>
17+
<directory>./Tests</directory>
18+
<directory>./vendor</directory>
19+
</exclude>
20+
</source>
2121
</phpunit>

0 commit comments

Comments
 (0)