Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
larseijman committed Mar 5, 2021
1 parent 0438db5 commit 20a3828
Show file tree
Hide file tree
Showing 35 changed files with 57 additions and 57 deletions.
2 changes: 1 addition & 1 deletion config/fmp.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@

'base_url' => env('FMP_BASE_URL', 'https://financialmodelingprep.com/api/v3/'),

];
];
4 changes: 2 additions & 2 deletions src/Calendars/DividendCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function getFullEndpoint(): string
public function setFromDate(string $fromDate): self
{
$this->fromDate = $fromDate;
array_push($this->query_string, ['from' => $fromDate]);
$this->query_string['from'] = $fromDate;

return $this;
}
Expand All @@ -64,7 +64,7 @@ public function setFromDate(string $fromDate): self
public function setToDate(string $toDate): self
{
$this->toDate = $toDate;
array_push($this->query_string, ['to' => $toDate]);
$this->query_string['to'] = $toDate;

return $this;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Calendars/EarningsCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function getFullEndpoint(): string
public function setFromDate(string $fromDate): self
{
$this->fromDate = $fromDate;
array_push($this->query_string, ['from' => $fromDate]);
$this->query_string['from'] = $fromDate;

return $this;
}
Expand All @@ -64,7 +64,7 @@ public function setFromDate(string $fromDate): self
public function setToDate(string $toDate): self
{
$this->toDate = $toDate;
array_push($this->query_string, ['to' => $toDate]);
$this->query_string['to'] = $toDate;

return $this;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Calendars/EconomicCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function getFullEndpoint(): string
public function setFromDate(string $fromDate): self
{
$this->fromDate = $fromDate;
array_push($this->query_string, ['from' => $fromDate]);
$this->query_string['from'] = $fromDate;

return $this;
}
Expand All @@ -64,7 +64,7 @@ public function setFromDate(string $fromDate): self
public function setToDate(string $toDate): self
{
$this->toDate = $toDate;
array_push($this->query_string, ['to' => $toDate]);
$this->query_string['to'] = $toDate;

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Calendars/HistoricalEarningsCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function getFullEndpoint(): string
*/
public function setLimit(int $limit): self
{
array_push($this->query_string, ['limit' => $limit]);
$this->query_string['limit'] = $limit;

return $this;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Calendars/IpoCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function getFullEndpoint(): string
public function setFromDate(string $fromDate): self
{
$this->fromDate = $fromDate;
array_push($this->query_string, ['from' => $fromDate]);
$this->query_string['from'] = $fromDate;

return $this;
}
Expand All @@ -64,7 +64,7 @@ public function setFromDate(string $fromDate): self
public function setToDate(string $toDate): self
{
$this->toDate = $toDate;
array_push($this->query_string, ['to' => $toDate]);
$this->query_string['to'] = $toDate;

return $this;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Calendars/StockSplitCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function getFullEndpoint(): string
public function setFromDate(string $fromDate): self
{
$this->fromDate = $fromDate;
array_push($this->query_string, ['from' => $fromDate]);
$this->query_string['from'] = $fromDate;

return $this;
}
Expand All @@ -64,7 +64,7 @@ public function setFromDate(string $fromDate): self
public function setToDate(string $toDate): self
{
$this->toDate = $toDate;
array_push($this->query_string, ['to' => $toDate]);
$this->query_string['to'] = $toDate;

return $this;
}
Expand Down
34 changes: 17 additions & 17 deletions src/CompanyValuation/StockScreener.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected function getFullEndpoint(): string
*/
public function setMarketCapMoreThan(int $market_cap_more_than): self
{
array_push($this->query_string, ['marketCapMoreThan' => $market_cap_more_than]);
$this->query_string['marketCapMoreThan'] = $market_cap_more_than;

return $this;
}
Expand All @@ -49,7 +49,7 @@ public function setMarketCapMoreThan(int $market_cap_more_than): self
*/
public function setMarketCapLowerThan(int $market_cap_lower_than): self
{
array_push($this->query_string, ['marketCapLowerThan' => $market_cap_lower_than]);
$this->query_string['marketCapLowerThan'] = $market_cap_lower_than;

return $this;
}
Expand All @@ -61,7 +61,7 @@ public function setMarketCapLowerThan(int $market_cap_lower_than): self
*/
public function setPriceMoreThan(int $price_more_than): self
{
array_push($this->query_string, ['priceMoreThan' => $price_more_than]);
$this->query_string['priceMoreThan'] = $price_more_than;

return $this;
}
Expand All @@ -73,7 +73,7 @@ public function setPriceMoreThan(int $price_more_than): self
*/
public function setPriceLowerThan(int $price_lower_than): self
{
array_push($this->query_string, ['priceLowerThan' => $price_lower_than]);
$this->query_string['priceLowerThan'] = $price_lower_than;

return $this;
}
Expand All @@ -85,7 +85,7 @@ public function setPriceLowerThan(int $price_lower_than): self
*/
public function setBetaMoreThan(int $beta_more_than): self
{
array_push($this->query_string, ['betaMoreThan' => $beta_more_than]);
$this->query_string['betaMoreThan'] = $beta_more_than;

return $this;
}
Expand All @@ -97,7 +97,7 @@ public function setBetaMoreThan(int $beta_more_than): self
*/
public function setBetaLowerThan(int $beta_lower_than): self
{
array_push($this->query_string, ['betaLowerThan' => $beta_lower_than]);
$this->query_string['betaLowerThan'] = $beta_lower_than;

return $this;
}
Expand All @@ -109,7 +109,7 @@ public function setBetaLowerThan(int $beta_lower_than): self
*/
public function setVolumeMoreThan(int $volume_more_than): self
{
array_push($this->query_string, ['volumeMoreThan' => $volume_more_than]);
$this->query_string['volumeMoreThan'] = $volume_more_than;

return $this;
}
Expand All @@ -121,7 +121,7 @@ public function setVolumeMoreThan(int $volume_more_than): self
*/
public function setVolumeLowerThan(int $volume_lower_than): self
{
array_push($this->query_string, ['volumeLowerThan' => $volume_lower_than]);
$this->query_string['volumeLowerThan'] = $volume_lower_than;

return $this;
}
Expand All @@ -133,7 +133,7 @@ public function setVolumeLowerThan(int $volume_lower_than): self
*/
public function setDividendMoreThan(int $dividend_more_than): self
{
array_push($this->query_string, ['dividendMoreThan' => $dividend_more_than]);
$this->query_string['dividendMoreThan'] = $dividend_more_than;

return $this;
}
Expand All @@ -145,7 +145,7 @@ public function setDividendMoreThan(int $dividend_more_than): self
*/
public function setDividendLowerThan(int $dividend_lower_than): self
{
array_push($this->query_string, ['dividendLowerThan' => $dividend_lower_than]);
$this->query_string['dividendLowerThan'] = $dividend_lower_than;

return $this;
}
Expand All @@ -157,7 +157,7 @@ public function setDividendLowerThan(int $dividend_lower_than): self
*/
public function setExchange(string $exchanges): self
{
array_push($this->query_string, ['exchange' => $exchanges]);
$this->query_string['exchange'] = $exchanges;

return $this;
}
Expand All @@ -169,7 +169,7 @@ public function setExchange(string $exchanges): self
*/
public function setLimit(int $limit): self
{
array_push($this->query_string, ['limit' => $limit]);
$this->query_string['limit'] = $limit;

return $this;
}
Expand All @@ -181,7 +181,7 @@ public function setLimit(int $limit): self
*/
public function setCountries(string $countries): self
{
array_push($this->query_string, ['country' => $countries]);
$this->query_string['country'] = $countries;

return $this;
}
Expand All @@ -193,7 +193,7 @@ public function setCountries(string $countries): self
*/
public function setIndustries(string $industries): self
{
array_push($this->query_string, ['industry' => $industries]);
$this->query_string['industry'] = $industries;

return $this;
}
Expand All @@ -205,7 +205,7 @@ public function setIndustries(string $industries): self
*/
public function setSectors(string $sectors): self
{
array_push($this->query_string, ['sector' => $sectors]);
$this->query_string['sector'] = $sectors;

return $this;
}
Expand All @@ -217,7 +217,7 @@ public function setSectors(string $sectors): self
*/
public function setIsActivelyTrading(bool $is_actively_trading): self
{
array_push($this->query_string, ['isActivelyTrading' => $is_actively_trading]);
$this->query_string['isActivelyTrading'] = $is_actively_trading;

return $this;
}
Expand All @@ -229,7 +229,7 @@ public function setIsActivelyTrading(bool $is_actively_trading): self
*/
public function setIsEtf(bool $is_etf): self
{
array_push($this->query_string, ['isEtf' => $is_etf]);
$this->query_string['isEtf'] = $is_etf;

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Contracts/Fmp.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ interface Fmp
* @return ResponseInterface
*/
public function send(RequestInterface $request, array $options = []): ResponseInterface;
}
}
2 changes: 1 addition & 1 deletion src/Exceptions/InvalidData.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public static function invalidDataProvided(string $message)
{
return new static($message);
}
}
}
2 changes: 1 addition & 1 deletion src/Facades/CompanyValuation/DiscountedCashFlow.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\CompanyValuation\DiscountedCashFlow::class;
}
}
}
2 changes: 1 addition & 1 deletion src/Facades/CompanyValuation/EarningsSurprises.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\CompanyValuation\EarningsSurprises::class;
}
}
}
2 changes: 1 addition & 1 deletion src/Facades/CompanyValuation/EtfsList.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\CompanyValuation\EtfsList::class;
}
}
}
2 changes: 1 addition & 1 deletion src/Facades/CompanyValuation/KeyExecutives.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\CompanyValuation\KeyExecutives::class;
}
}
}
2 changes: 1 addition & 1 deletion src/Facades/CompanyValuation/MarketCapitalization.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\CompanyValuation\MarketCapitalization::class;
}
}
}
2 changes: 1 addition & 1 deletion src/Facades/CompanyValuation/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\CompanyValuation\Profile::class;
}
}
}
2 changes: 1 addition & 1 deletion src/Facades/CompanyValuation/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\CompanyValuation\Quote::class;
}
}
}
2 changes: 1 addition & 1 deletion src/Facades/CompanyValuation/Rating.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\CompanyValuation\Rating::class;
}
}
}
2 changes: 1 addition & 1 deletion src/Facades/CompanyValuation/StockScreener.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\CompanyValuation\StockScreener::class;
}
}
}
2 changes: 1 addition & 1 deletion src/Facades/CompanyValuation/SymbolsList.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\CompanyValuation\SymbolsList::class;
}
}
}
2 changes: 1 addition & 1 deletion src/Facades/CompanyValuation/TradableSymbolsList.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\CompanyValuation\TradableSymbolsList::class;
}
}
}
2 changes: 1 addition & 1 deletion src/InstitutionalFunds/Form13F.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected function getFullEndpoint(): string
public function setDate(string $date): self
{
$this->date = $date;
array_push($this->query_string, ['date' => $date]);
$this->query_string['date'] = $date;

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/InstitutionalFunds/SecRssFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected function getFullEndpoint(): string
*/
public function setLimit(int $limit): self
{
array_push($this->query_string, ['limit' => $limit]);
$this->query_string['limit'] = $limit;

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/StockMarket/SectorsPerformance.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct(Fmp $api)
*/
public function setLimit(int $limit): self
{
array_push($this->query_string, ['limit' => $limit]);
$this->query_string['limit'] = $limit;

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function setupMockedClient(Response $response)
$handler = HandlerStack::create($mock);
$client = new Client(['handler' => $handler]);

return new \Leijman\FmpApiSdk\Client($client);
return new \Leijman\FmpApiSdk\Client($client);
}

protected function getPackageProviders($app)
Expand Down
4 changes: 2 additions & 2 deletions tests/Calendars/HistoricalEarningsCalendarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ protected function setUp(): void
/** @test */
public function it_should_fail_without_a_symbol()
{
$quote = new \Leijman\FmpApiSdk\Calendars\HistoricalEarningsCalendar($this->client);
$historical_earnings_calendar = new \Leijman\FmpApiSdk\Calendars\HistoricalEarningsCalendar($this->client);

$this->expectException(InvalidData::class);

$quote->get();
$historical_earnings_calendar->get();
}

/** @test */
Expand Down
Loading

0 comments on commit 20a3828

Please sign in to comment.