Skip to content

Commit

Permalink
The "@brief" annotation is not DocBlock standard and causes an error.
Browse files Browse the repository at this point in the history
- I change the comments of the code following the standard
- Declaration of a variable in invalid comment
  • Loading branch information
Daniel Esteve committed Aug 2, 2022
1 parent b1e0011 commit 9c75f0a
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 30 deletions.
5 changes: 2 additions & 3 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
* @brief The configuration class for the bundle, fairly straightforward
* The configuration class for the bundle, fairly straightforward
*
* The hCaptcha site key and secret are inside a 'hcaptcha' key in case we
* need more configuration unrelated to hCaptcha later.
* The hCaptcha site key and secret are inside a 'hcaptcha' key in case we need more configuration unrelated to hCaptcha later.
*/
class Configuration implements ConfigurationInterface
{
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/MeteoConceptHCaptchaExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;

/**
* @brief The bundle extension class, used to load the configuration
* The bundle extension class, used to load the configuration
*/
class MeteoConceptHCaptchaExtension extends Extension
{
Expand Down
5 changes: 2 additions & 3 deletions Exception/BadAnswerFromHCaptchaException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
namespace MeteoConcept\HCaptchaBundle\Exception;

/**
* @brief An exception representing a bad answer from the hCaptcha API
* (either no response, or HTTP code !== 200, or response body not looking
* like the specification, etc.)
* An exception representing a bad answer from the hCaptcha API
* (either no response, or HTTP code !== 200, or response body not looking like the specification, etc.)
*/
class BadAnswerFromHCaptchaException extends \RuntimeException
{
Expand Down
9 changes: 3 additions & 6 deletions Form/DataTransformer/HCaptchaValueFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
use MeteoConcept\HCaptchaBundle\Form\HCaptchaResponse;

/**
* @brief A weird data transformer that actually does not act on the
* field value but on a specific POST variables in the request
* A weird data transformer that actually does not act on the field value but on a specific POST variables in the request
*/
class HCaptchaValueFetcher implements DataTransformerInterface
{
Expand All @@ -26,8 +25,7 @@ class HCaptchaValueFetcher implements DataTransformerInterface
protected $siteKey;

/**
* @brief Constructs an instance of the HCaptchaValueFetcher from
* injected dependencies
* Constructs an instance of the HCaptchaValueFetcher from injected dependencies
*
* This class does nothing useful when displaying the form, it's
* only useful on a POST request, when the form is submitted.
Expand All @@ -41,8 +39,7 @@ public function __construct(RequestStack $requestStack)
}

/**
* @brief Set the hCaptcha site key configured for the form to which this
* data transformer is attached
* Set the hCaptcha site key configured for the form to which this data transformer is attached
*
* This site key is then embedded into the value of the hCaptcha form widget
* in order to be sent to hCaptcha as pert of the verification request.
Expand Down
14 changes: 6 additions & 8 deletions Form/HCaptchaResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
namespace MeteoConcept\HCaptchaBundle\Form;

/**
* @brief Stores the values put in the POST request by hCaptcha
* Stores the values put in the POST request by hCaptcha
*
* This class is mostly there for type safety. It's used both by the
* HCaptchaFormType and the IsValidCaptcha constraint.
* This class is mostly there for type safety. It's used both by the HCaptchaFormType and the IsValidCaptcha constraint.
*/
final class HCaptchaResponse
{
Expand All @@ -29,8 +28,7 @@ final class HCaptchaResponse
private $siteKey;

/**
* @brief Constructs an immutable instance of HCaptchaResponse from a
* hCaptcha response and a user's IP address
* Constructs an immutable instance of HCaptchaResponse from a hCaptcha response and a user's IP address
*
* @param $response string The user's response to the CAPTCHA
* challenge
Expand All @@ -44,7 +42,7 @@ public function __construct(string $response, ?string $remoteIp, ?string $siteKe
}

/**
* @brief Gets the CAPTCHA challenge response
* Gets the CAPTCHA challenge response
*
* @return string The CAPTCHA challenge response set at the construction of
* the instance
Expand All @@ -55,7 +53,7 @@ public function getResponse(): string
}

/**
* @brief Gets the user's IP address
* Gets the user's IP address
*
* @return string|null The user's IP address set at the construction of the
* instance
Expand All @@ -66,7 +64,7 @@ public function getRemoteIp(): ?string
}

/**
* @brief Gets the hCaptcha site key
* Gets the hCaptcha site key
*
* @return string|null The hCaptcha site key configured for the form, to be
* sent back in the hCaptcha verification request
Expand Down
7 changes: 3 additions & 4 deletions Form/HCaptchaType.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@
use MeteoConcept\HCaptchaBundle\Validator\Constraints\IsValidCaptcha;

/**
* @brief A form type that represents a hCaptcha field/widget that the user
* must solve before submitting the form
* A form type that represents a hCaptcha field/widget that the user must solve before submitting the form
*/
class HCaptchaType extends AbstractType
{
/**
* @var HCaptchValueFetcher The data transformer used to get the CAPTCHA
* @var HCaptchaValueFetcher The data transformer used to get the CAPTCHA
* response
*/
private $valueFetcher;
Expand All @@ -33,7 +32,7 @@ class HCaptchaType extends AbstractType
private $hcaptchaSiteKey;

/**
* @brief Constructs the form type from injected dependencies
* Constructs the form type from injected dependencies
*
* @param HCaptchaValueFetcher $hcaptchaValueFetcher An instance of the
* HCaptchaValueFetcher service
Expand Down
2 changes: 1 addition & 1 deletion MeteoConceptHCaptchaBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
* @brief This class makes the project a Symfony bundle
* This class makes the project a Symfony bundle
*/
class MeteoConceptHCaptchaBundle extends Bundle
{
Expand Down
2 changes: 1 addition & 1 deletion Service/HCaptchaVerifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class HCaptchaVerifier
const HCAPTCHA_VERIFY_URL = 'https://hcaptcha.com/siteverify';

/**
* @brief Constructs the validator from injected dependencies
* Constructs the validator from injected dependencies
*
* @param ClientInterface $client The PSR-18 HTTP client service to make the
* API call to hCaptcha
Expand Down
2 changes: 1 addition & 1 deletion Validator/Constraints/IsValidCaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Symfony\Component\Validator\Constraint;

/**
* @brief Screams when the user has failed to solve the CAPTCHA
* Screams when the user has failed to solve the CAPTCHA
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*/
Expand Down
4 changes: 2 additions & 2 deletions Validator/Constraints/IsValidCaptchaValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use MeteoConcept\HCaptchaBundle\Service\HCaptchaVerifier;

/**
* @brief Validates a CAPTCHA using the hCaptcha API
* Validates a CAPTCHA using the hCaptcha API
*
* The value that the validator works with must be an instance of
* HCaptchaResponse, such as the one built by
Expand Down Expand Up @@ -45,7 +45,7 @@ class IsValidCaptchaValidator extends ConstraintValidator
private $validation;

/**
* @brief Constructs the validator from injected dependencies
* Constructs the validator from injected dependencies
*
* @param HCaptchaVerifier $verifier The service that sends the verification
* request to the hCaptcha endpoint
Expand Down

0 comments on commit 9c75f0a

Please sign in to comment.