Skip to content

Drupal Practice ref added#1074

Merged
klausi merged 19 commits intodrupal-graphql:8.x-4.xfrom
Dylan203:fix/cs-fixes-iteration-12
Aug 31, 2020
Merged

Drupal Practice ref added#1074
klausi merged 19 commits intodrupal-graphql:8.x-4.xfrom
Dylan203:fix/cs-fixes-iteration-12

Conversation

@Dylan203
Copy link
Copy Markdown
Contributor

DrupalPractice Reference added

Copy link
Copy Markdown
Contributor

@klausi klausi left a comment

Choose a reason for hiding this comment

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

Nice, looks like we don't need to fix too much. Some small things to change.

Comment thread phpcs.xml.dist
<rule ref="Drupal"></rule>
<rule ref="DrupalPractice">
<!-- Here Variables would have had to been removed-->
<exclude-pattern>src/Plugin/GraphQL/DataProducer/DataProducerProxy.php</exclude-pattern>

This comment was marked as resolved.

dependencies:
- graphql:graphql
- node:node
core_version_requirement: 8.x
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should be core_version_requirement: ^8 || ^9 like in the main graphql.info.yml file

'#type' => 'checkboxes',
'#required' => FALSE,
'#title' => t('Enabled extensions'),
'#title' => $this->t('Enabled extensions'),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not sure if this class has the StringTranslationTrait so that this method is available.

Can you test this in local Drupal install by going to the graphql user interface?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok figured out that it doesn't have that method

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok, then we need to add use StringTranslationTrait; to this class.

See for example src/PermissionProvider.php which implements the trait and also has the namespace use statement for it.

dependencies:
- graphql:graphql
- node:node
core_version_requirement: 8.x
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same here

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 26, 2020

Codecov Report

Merging #1074 into 8.x-4.x will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             8.x-4.x    #1074   +/-   ##
==========================================
  Coverage      50.51%   50.51%           
  Complexity       674      674           
==========================================
  Files            118      118           
  Lines           1827     1827           
==========================================
  Hits             923      923           
  Misses           904      904           
Impacted Files Coverage Δ Complexity Δ
.../Plugin/GraphQL/DataProducer/DataProducerProxy.php 40.20% <ø> (ø) 36.00 <0.00> (ø)
...gin/GraphQL/DataProducer/Entity/EntityRendered.php 0.00% <ø> (ø) 3.00 <0.00> (ø)
.../Plugin/GraphQL/DataProducer/Routing/RouteLoad.php 50.00% <ø> (ø) 6.00 <0.00> (ø)
src/Plugin/GraphQL/Schema/ComposableSchema.php 0.00% <0.00%> (ø) 11.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0ad5a8f...b717036. Read the comment docs.

@klausi
Copy link
Copy Markdown
Contributor

klausi commented Aug 31, 2020

Looks like you mixed in the phstan changes here, let's do that in a separate pull request.

so we only need to add the StringTranslationTrait for this one class and then we should be good here.

Comment thread phpcs.xml.dist
<rule ref="Drupal"></rule>
<rule ref="DrupalPractice"></rule>

<rule ref="DrupalPractice.CodeAnalysis.VariableAnalysis.UnusedVariable">

This comment was marked as resolved.

Comment thread src/Controller/RequestController.php Outdated
* @param \Drupal\graphql\Entity\ServerInterface $graphql_server
* The server instance.
* @param \GraphQL\Server\OperationParams|\GraphQL\Server\OperationParams[] $operations
* @param \Drupal\graphql\Controller\OperationParams|\Drupal\graphql\Controller\OperationParams[] $operations
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should not change this type, tests are failing. We should keep \GraphQL\Server\OperationParams.

Comment thread src/Controller/RequestController.php Outdated
* @throws \Exception
*/
public function handleRequest(ServerInterface $graphql_server, $operations) {
public function handleRequest(ServerInterface $graphql_server, OperationParams $operations) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should not change this function signature.

@klausi klausi merged commit b93c456 into drupal-graphql:8.x-4.x Aug 31, 2020
@klausi
Copy link
Copy Markdown
Contributor

klausi commented Aug 31, 2020

Travis CI is green, we don't care about the code coverage part. Thank you!

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