Skip to content

Commit

Permalink
Apply fixes from StyleCI (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
XavRsl authored Aug 3, 2023
1 parent ce63a4b commit a2e9ca6
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 31 deletions.
16 changes: 8 additions & 8 deletions src/Models/Authors.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ protected function addUnknownAttributes(array $authors, int $counter): void
/**
* Should the current attribute be added to the author array?
*
* @param $counter
* @param $key
* @param $value
* @param $counter
* @param $key
* @param $value
* @return bool
*/
protected function attributeShouldBeAdded($counter, $key, $value)
Expand All @@ -70,8 +70,8 @@ protected function attributeShouldBeAdded($counter, $key, $value)
/**
* Is this attribute already known?
*
* @param $counter
* @param $key
* @param $counter
* @param $key
* @return bool
*/
protected function noKnownAttribute($counter, $key)
Expand All @@ -83,9 +83,9 @@ protected function noKnownAttribute($counter, $key)
/**
* Did we find a longer first name?
*
* @param $counter
* @param $key
* @param $value
* @param $counter
* @param $key
* @param $value
* @return bool
*/
protected function foundLongerFirstName($counter, $key, $value)
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/Extractors/Crossref.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function extractLinksData(): void
}

/**
* @param $array
* @param $array
* @return mixed
*/
protected function extractDateFrom($array)
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/Extractors/EutilsEfetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function extractUpdatesData(): void
}

/**
* @param $correction
* @param $correction
*/
protected function getUpdateFromCorrection($correction): void
{
Expand Down Expand Up @@ -133,7 +133,7 @@ protected function loopOverAuthors(): void
/**
* Create an author entry in output.
*
* @param $author
* @param $author
*/
protected function createAuthorEntry($author): void
{
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/Extractors/Extractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected function addOutputSource(): void
/**
* Extract data from each type of the Resource.
*
* @param $type
* @param $type
*/
protected function extractData($type): void
{
Expand All @@ -105,7 +105,7 @@ protected function extractData($type): void
/**
* Build data output for each Resource type.
*
* @param $type
* @param $type
*/
protected function buildOutput($type): void
{
Expand Down
2 changes: 1 addition & 1 deletion src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class Schema
/**
* Validate the data against Schema.
*
* @param $data
* @param $data
*/
public static function validate($data): ValidatorResult
{
Expand Down
12 changes: 6 additions & 6 deletions src/Support/DateHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static function dateFromDateParts(array $parts)
}

/**
* @param $formattedDate
* @param $formattedDate
* @return string
*/
public static function dateFromParseableFormat($formattedDate)
Expand All @@ -34,7 +34,7 @@ public static function dateFromParseableFormat($formattedDate)
}

/**
* @param $pubDateObject
* @param $pubDateObject
* @return mixed|string
*/
public static function dateFromPubDate($pubDateObject)
Expand All @@ -60,7 +60,7 @@ public static function dateFromHumanReadable($dateString)
}

/**
* @param $pubDateObject
* @param $pubDateObject
* @return int|string
*/
protected static function getPubDateMonth($pubDateObject)
Expand All @@ -75,8 +75,8 @@ protected static function getPubDateMonth($pubDateObject)
}

/**
* @param $date
* @param $count
* @param $date
* @param $count
* @return mixed
*/
protected static function formatForParts($date, $count)
Expand All @@ -91,7 +91,7 @@ protected static function formatForParts($date, $count)
}

/**
* @param $pubDateObject
* @param $pubDateObject
* @return mixed
*/
protected static function countObjectParts($pubDateObject)
Expand Down
2 changes: 1 addition & 1 deletion src/Support/UpdateTypesStandardiser.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class UpdateTypesStandardiser
];

/**
* @param $type
* @param $type
* @return mixed
*/
public static function getType($type)
Expand Down
6 changes: 3 additions & 3 deletions src/Support/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

if (! function_exists('get_class_name')) {
/**
* @param $object
* @param $object
* @return string
*/
function get_class_name($object)
Expand Down Expand Up @@ -74,7 +74,7 @@ function date_from_human_readable($string)
* Get string from array path.
*
* @param array $array
* @param $key
* @param $key
* @param mixed $default
* @return string
*/
Expand All @@ -89,7 +89,7 @@ function get_string($array, $key, $default = null)
* Get array from dot access key.
*
* @param mixed $target
* @param $key
* @param $key
* @param array $default
* @return array
*/
Expand Down
6 changes: 6 additions & 0 deletions tests/Integration/FetcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class FetcherTest extends TestCase
{
/**
* @test
*
* @group internet
*/
public function it_fetches_data_from_a_doi_identifier()
Expand All @@ -27,6 +28,7 @@ public function it_fetches_data_from_a_doi_identifier()

/**
* @test
*
* @group internet
*/
public function it_fetches_data_from_a_pubmed_doi_identifier()
Expand All @@ -44,6 +46,7 @@ public function it_fetches_data_from_a_pubmed_doi_identifier()

/**
* @test
*
* @group internet
*/
public function it_fetches_data_from_a_arxiv_identifier()
Expand All @@ -61,6 +64,7 @@ public function it_fetches_data_from_a_arxiv_identifier()

/**
* @test
*
* @group internet
*/
public function it_fetches_data_from_a_pubmed_identifier()
Expand All @@ -78,6 +82,7 @@ public function it_fetches_data_from_a_pubmed_identifier()

/**
* @test
*
* @group internet
*/
public function it_fetches_data_from_a_doi_book_identifier()
Expand All @@ -95,6 +100,7 @@ public function it_fetches_data_from_a_doi_book_identifier()

/**
* @test
*
* @group internet
*/
public function it_lists_errors_from_rejected_api_calls()
Expand Down
1 change: 1 addition & 0 deletions tests/Integration/OutputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class OutputTest extends TestCase
{
/**
* @test
*
* @group forever
*/
public function test_20_randomly_selected_identifiers()
Expand Down
14 changes: 7 additions & 7 deletions tests/TestHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ trait TestHelpers
/**
* Sets a protected property on a given object via reflection.
*
* @param $object - instance in which protected value is being modified
* @param $property - property on instance being modified
* @param $value - new value of the property being modified
* @param $object - instance in which protected value is being modified
* @param $property - property on instance being modified
* @param $value - new value of the property being modified
*
* @throws \ReflectionException
*/
Expand All @@ -27,8 +27,8 @@ public function setProtectedProperty($object, $property, $value)
/**
* Gets a protected property on a given object via reflection.
*
* @param $object - instance in which protected value is being modified
* @param $property - property on instance being modified
* @param $object - instance in which protected value is being modified
* @param $property - property on instance being modified
* @return mixed
*
* @throws \ReflectionException
Expand Down Expand Up @@ -64,7 +64,7 @@ public function invokeMethod(&$object, $methodName, array $parameters = [])
/**
* Loads and decodes Json file.
*
* @param $name
* @param $name
* @return mixed
*/
public function loadJson($name)
Expand All @@ -75,7 +75,7 @@ public function loadJson($name)
/**
* Loads and decodes Xml file.
*
* @param $name
* @param $name
* @return SimpleXMLElement
*/
public function loadXml($name)
Expand Down

0 comments on commit a2e9ca6

Please sign in to comment.