Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add p2p plugin for static analysis #200

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

szepeviktor
Copy link
Contributor

@szepeviktor szepeviktor commented Apr 30, 2022

Adding p2p:

composer require --dev scribu/lib-posts-to-posts:dev-master scribu/scb-framework:dev-master

Analysis result:

 ------ -----------------------------------------------------------
  Line   src/PostTypeAdmin.php
 ------ -----------------------------------------------------------
  1242   Cannot call method each_connected() on object|true.
  1474   Cannot call method direction_from_types() on object|true.
  1475   Cannot access property $side on object|true.
 ------ -----------------------------------------------------------

@johnbillion I leave this 💯% up to you.

@szepeviktor
Copy link
Contributor Author

szepeviktor commented Apr 30, 2022

The first step could be to add strict conditions.

// if ( $ctype )
if ( is_object( $ctype ) )
// or
if ( $ctype instanceof \P2P_Connection_Type )

But I do not know how this project operates.

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

Successfully merging this pull request may close these issues.

2 participants