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

[CS] Add missing method scope and fix function comment style #1751

Merged
merged 2 commits into from
Mar 14, 2018
Merged

[CS] Add missing method scope and fix function comment style #1751

merged 2 commits into from
Mar 14, 2018

Conversation

carusogabriel
Copy link
Contributor

No description provided.

@@ -66,7 +66,6 @@ public static function getDateTime($value)
return $datetime;
}

// @todo fix typing for $microseconds
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one was auto removed. Should we allow the @todo annotation in our CS?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I believe this is a good idea. There will be a few of those left in while we work in 2.0. We should however remove the exception before tagging 2.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll move these @todo annotations inside the method scope instead of keeping them as annotations :)

@@ -12,7 +12,6 @@

class AnnotationDriverTest extends AbstractMappingDriverTest
{
// @TODO: This can be a generic test for all drivers
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one was auto removed. Should we allow the @TODO annotation in our CS?

@@ -116,8 +116,7 @@ public function testRegisterRemovedOnNewEntityIsIgnored()
}


/* Operational tests */

/** Operational tests */
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this a false-positive forcing to be a function comment?

Copy link
Member

Choose a reason for hiding this comment

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

I think yes

Copy link
Member

Choose a reason for hiding this comment

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

This is also just a useless comment that we could remove.

@@ -51,7 +51,7 @@ class DateCollectionType
{
use ClosureToPHP;

// Note: this method is called by PersistenceBuilder
/** Note: this method is called by PersistenceBuilder */
Copy link
Member

Choose a reason for hiding this comment

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

This should either be a proper docblock or dropped completely: the information where it's called from can change any time and can easily be inferred from the IDE. If we want to add a comment (which might be better off in the base class as it applies to all types) we should explain what the method is expected to do.

@@ -90,7 +90,7 @@ public function convertToPHPValue($value)
return $value;
}

// Note: this method is never called
/** Note: this method is never called */
Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

@@ -389,7 +389,7 @@ public function testQueryWhereInReferenceId()
$this->assertSame($expected, $qb->getQuery()->debug('query'));
}

// search for articles that have the "pet" tag in their tags collection
/** search for articles that have the "pet" tag in their tags collection */
Copy link
Member

Choose a reason for hiding this comment

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

TBH, the value of this comment is 0 - I can see what it's doing in the code. I suggest removing this kind of comments entirely.

@@ -48,7 +48,7 @@ class GH1294User
/** @ODM\Field(type="string") */
public $name = false;

// Return the identifier without triggering Proxy initialization
/** Return the identifier without triggering Proxy initialization */
Copy link
Member

Choose a reason for hiding this comment

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

The comment refers to an implementational detail of proxies, which is irrelevant in the base class. Again, I suggest dropping this comment and the ones like it.

@@ -48,8 +48,7 @@ public function setRecId($value = null)
$this->recId = $value;
}

/* Added automatically 2010-08-03 */

/** Added automatically 2010-08-03 */
Copy link
Member

Choose a reason for hiding this comment

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

This is virtually useless.

@@ -116,8 +116,7 @@ public function testRegisterRemovedOnNewEntityIsIgnored()
}


/* Operational tests */

/** Operational tests */
Copy link
Member

Choose a reason for hiding this comment

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

This is also just a useless comment that we could remove.

@carusogabriel
Copy link
Contributor Author

@alcaeus Comments changes available in 4ff476e

@alcaeus alcaeus merged commit 86e4a27 into doctrine:master Mar 14, 2018
@carusogabriel carusogabriel deleted the missing-method-scope branch March 14, 2018 18:31
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.

None yet

3 participants