Initial commit: apps.prometeysev.ru
This commit is contained in:
commit
96ccabcd8b
6561 files changed
+1270349
No files matched your search
+9
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* If shortopen tags are not enabled phpcs will report that the file has no php code
|
||||
* Ensure that there is some php code to skip that logic
|
||||
*/
|
||||
$ensure = 'some php code'; ?>
|
||||
|
||||
<?
|
||||
echo "this should fail";
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace CakePHP\Tests\PHP;
|
||||
|
||||
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
|
||||
|
||||
class DisallowShortOpenTagUnitTest extends AbstractSniffUnitTest
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getErrorList()
|
||||
{
|
||||
return [
|
||||
8 => 1,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getWarningList()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
//Fail
|
||||
$isActive = !!$value;
|
||||
$isActive = (boolean)$value;
|
||||
$count = (integer)$someNumber;
|
||||
$isActive = (Bool)$value;
|
||||
$count = (Int)$someNumber;
|
||||
|
||||
//Pass
|
||||
$isActive = (bool)$value;
|
||||
$count = (int)$someNumber;
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace CakePHP\Tests\PHP;
|
||||
|
||||
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
|
||||
|
||||
class TypeCastingUnitTest extends AbstractSniffUnitTest
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getErrorList()
|
||||
{
|
||||
return [
|
||||
3 => 1,
|
||||
4 => 1,
|
||||
5 => 1,
|
||||
6 => 1,
|
||||
7 => 1,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getWarningList()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user