Skip to content

Small code improvements #286

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

Merged
merged 1 commit into from
Dec 29, 2017

Conversation

seregazhuk
Copy link
Contributor

This PR provides some small code improvement:

  • removes unused private properties
  • removes redundant fully-specified class name
  • removes arguments that are identical to their default values
  • adds missed class imports
  • removes unnecessary type casting

Copy link
Member

@clue clue left a comment

Choose a reason for hiding this comment

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

Good catch and thank you for filing this PR! 👍 Can you update the comments below and maybe squash this to a reasonable number of commits?

use RingCentral\Psr7\Request;
use InvalidArgumentException;
Copy link
Member

Choose a reason for hiding this comment

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

It looks like these imports aren't used anywhere?

Copy link
Contributor Author

@seregazhuk seregazhuk Dec 28, 2017

Choose a reason for hiding this comment

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

Actually, constructor has @throws annotation. My IDE (PHPStorm) highlights it with undefined class InvalidArgumentException. I've removed import and added root namespace to annotation.

@@ -17,7 +17,6 @@
* */
class CloseProtectionStream extends EventEmitter implements ReadableStreamInterface
{
private $connection;
Copy link
Member

Choose a reason for hiding this comment

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

Good catch! Apparently, this should be replaced with $input which is used in the constructor 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@seregazhuk seregazhuk force-pushed the small-code-improvements branch from e03f56a to 742a015 Compare December 28, 2017 14:42
@seregazhuk seregazhuk force-pushed the small-code-improvements branch from 742a015 to ceba730 Compare December 28, 2017 14:50
@seregazhuk
Copy link
Contributor Author

@clue I've updated the request according to your comments :octocat:

Copy link
Member

@clue clue left a comment

Choose a reason for hiding this comment

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

Thank you for the quick update! 👍

@WyriHaximus WyriHaximus merged commit f8f029c into reactphp:master Dec 29, 2017
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.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy