Skip to content

Add PHP 8 issues#31

Open
arianakataokatesting wants to merge 1 commit intomainfrom
feature/php-8
Open

Add PHP 8 issues#31
arianakataokatesting wants to merge 1 commit intomainfrom
feature/php-8

Conversation

@arianakataokatesting
Copy link
Collaborator

No description provided.

Copy link
Owner

@ariskataoka ariskataoka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phpcs-scanning skipped


hashes-api-scanning skipped


skipped-files

Maximum number of lines exceeded (25000):

  • large-php-file-original.php

Note that the above file(s) were not analyzed due to their length.

Copy link
Owner

@ariskataoka ariskataoka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phpcs-scanning skipped


hashes-api-scanning skipped

Copy link
Owner

@ariskataoka ariskataoka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phpcs scanning turned up:

🚫 1 error

⚠️ 3 warnings


hashes-api-scanning skipped

* @return bool
*/
function find_my_string( $a, $b ): bool {
if ( $x = str_contains( $a, $b ) ) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Variable assignment found within a condition. Did you mean to do a comparison? (WordPress.CodeAnalysis.AssignmentInCondition.Found).

return $x;
}
$result2 = find_my_string('a', 'b');
var_dump( $result2 );
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: var_dump() found. Debug code should not normally be used in production (WordPress.PHP.DevelopmentFunctions.error_log_var_dump).

$result = fn( $c ) => $c . php8_fun( $my_super_array[ array_rand( $my_super_array, 1 ) ] );

$x = 'x';
var_dump( $result($x) );
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: var_dump() found. Debug code should not normally be used in production (WordPress.PHP.DevelopmentFunctions.error_log_var_dump).

public function method(array $a) {}
}
class C2 extends C1 {
public function method(int $a) {}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: PHP syntax error: Declaration of C2::method(int $a) must be compatible with C1::method(array $a) (Generic.PHP.Syntax.PHPSyntax).

Copy link
Owner

@ariskataoka ariskataoka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hashes-api-scanning skipped

@ariskataoka
Copy link
Owner

PHP Syntax Errors Found

Scan performed on the code at commit a83620c (view code).


Error: syntax error, unexpected end of file, expecting "," or ";"

https://github.com/ariskataoka/vipgoci-tests/blob/a83620cf866f59ec4b434a0e3cca300f5299bc63/src/SyntaxError.php#L4

Copy link
Owner

@ariskataoka ariskataoka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hashes-api-scanning skipped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants