File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444 }
4545 ],
4646 "require" :{
47- "cakephp/cakephp" : " ^4.0 "
47+ "cakephp/cakephp" : " ^4.2 "
4848 },
4949 "require-dev" : {
50- "phpunit/phpunit" : " ~8 .5.0" ,
50+ "phpunit/phpunit" : " ^9 .5.0" ,
5151 "cakephp/cakephp-codesniffer" : " ^4.0"
5252 },
5353 "autoload" : {
7777 "stan" : " phpstan analyse && psalm" ,
7878 "phpstan" : " phpstan analyse" ,
7979 "psalm" : " psalm --show-info=false" ,
80- "stan-setup" : " cp composer.json composer.backup && composer require --dev phpstan/phpstan:^0.12 vimeo/psalm:^3.7 && mv composer.backup composer.json" ,
80+ "stan-setup" : " cp composer.json composer.backup && composer require --dev phpstan/phpstan:^1.0.0 vimeo/psalm:^5.0 && mv composer.backup composer.json" ,
8181 "test-coverage" : " phpunit --coverage-clover=clover.xml"
82+ },
83+ "config" : {
84+ "allow-plugins" : {
85+ "dealerdirect/phpcodesniffer-composer-installer" : true
86+ }
8287 }
8388}
Original file line number Diff line number Diff line change 11parameters :
2- level : 6
2+ level : 8
33 checkMissingIterableValueType : false
44 paths :
5- - src
5+ - src/
66 bootstrapFiles :
77 - tests/bootstrap.php
Original file line number Diff line number Diff line change 33
44namespace CsvView \View ;
55
6+ use Cake \Core \Exception \CakeException ;
67use Cake \Datasource \EntityInterface ;
78use Cake \Utility \Hash ;
89use Cake \View \SerializedView ;
@@ -304,7 +305,11 @@ protected function _generateRow(?array $row = null)
304305 }
305306
306307 if ($ fp === false ) {
307- $ fp = fopen ('php://temp ' , 'r+ ' );
308+ $ stream = 'php://temp ' ;
309+ $ fp = fopen ($ stream , 'r+ ' );
310+ if ($ fp === false ) {
311+ throw new CakeException (sprintf ('Cannot open stream `%s` ' , $ stream ));
312+ }
308313
309314 $ setSeparator = $ this ->getConfig ('setSeparator ' );
310315 if ($ setSeparator ) {
Original file line number Diff line number Diff line change 55
66use Cake \Http \Response ;
77use Cake \Http \ServerRequest as Request ;
8- use Cake \I18n \Time ;
8+ use Cake \I18n \FrozenTime ;
99use Cake \ORM \TableRegistry ;
1010use Cake \TestSuite \TestCase ;
1111use CsvView \View \CsvView ;
@@ -34,7 +34,7 @@ class CsvViewTest extends TestCase
3434
3535 public function setUp (): void
3636 {
37- Time ::setToStringFormat ('yyyy-MM-dd HH:mm:ss ' );
37+ FrozenTime ::setToStringFormat ('yyyy-MM-dd HH:mm:ss ' );
3838
3939 $ this ->request = new Request ();
4040 $ this ->response = new Response ();
@@ -267,7 +267,7 @@ public function testRenderViaExtract()
267267 [
268268 'User ' => [
269269 'username ' => 'jose ' ,
270- 'created ' => new Time ('2010-01-05 ' ),
270+ 'created ' => new FrozenTime ('2010-01-05 ' ),
271271 ],
272272 'Item ' => [
273273 'name ' => 'beach ' ,
@@ -343,7 +343,7 @@ public function testRenderViaExtractWithCallable()
343343 $ data = [
344344 [
345345 'username ' => 'jose ' ,
346- 'created ' => new Time ('2010-01-05 ' ),
346+ 'created ' => new FrozenTime ('2010-01-05 ' ),
347347 'item ' => [
348348 'name ' => 'beach ' ,
349349 ],
You can’t perform that action at this time.
0 commit comments