Skip to content

Commit

Permalink
Update doc blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
timirey committed Jul 30, 2024
1 parent 0b86cd5 commit f13c259
Show file tree
Hide file tree
Showing 46 changed files with 50 additions and 181 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Run PHP CodeSniffer
run: vendor/bin/phpcs --severity=6
run: vendor/bin/phpcs --severity=6 # change to 1

- name: Run PHP Stan
run: vendor/bin/phpstan analyse src --level=8
Expand Down
19 changes: 5 additions & 14 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
<?xml version="1.0"?>
<ruleset name="Custom Ruleset">
<description>PSR-12</description>
<description>PSR-12 with custom sniffs</description>

<!-- Set the coding standard to PSR-12 -->
<rule ref="PSR12">
<severity>10</severity>
</rule>
<rule ref="PSR12"/>

<!-- Add custom rules for PHPDoc -->
<rule ref="Squiz.Commenting.ClassComment">
<severity>5</severity>
</rule>
<rule ref="Squiz.Commenting.FunctionComment">
<severity>5</severity>
</rule>
<rule ref="Squiz.Commenting.VariableComment">
<severity>5</severity>
</rule>
<rule ref="Squiz.Commenting.ClassComment"/>
<rule ref="Squiz.Commenting.FunctionComment"/>
<rule ref="Squiz.Commenting.VariableComment"/>

<!-- Add rule to remove unused use statements -->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<severity>6</severity>
<properties>
<property name="searchAnnotations" value="true"/>
</properties>
Expand Down
12 changes: 0 additions & 12 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,7 @@
use Timirey\XApi\Responses\TradeTransactionStatusResponse;

/**
* Class Client
*
* A client for interacting with the xStation5 API.
*
* @package Timirey\XApi
*
* @property SocketConnection $request Connection for sending requests.
* @property SocketConnection $stream Connection for handling streaming data.
* @property string $streamSessionId Session ID for the streaming connection.
* @property int $userId User ID for login.
* @property string $password User password for login.
* @property Host $host Host configuration.
* @property string|null $appName Optional application name.
*/
class Client
{
Expand Down
8 changes: 2 additions & 6 deletions src/Enums/Host.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@
enum Host: string
{
/**
* Demo account type.
*
* @var string
* @const Demo account type.
*/
case DEMO = 'demo';

/**
* Real account type.
*
* @var string
* @const Real account type.
*/
case REAL = 'real';

Expand Down
8 changes: 1 addition & 7 deletions src/Payloads/AbstractStreamPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Timirey\XApi\Payloads;

use JsonException;
use Override;
use Timirey\XApi\Exceptions\InvalidPayloadException;

Expand All @@ -22,12 +21,7 @@ public function __construct(string $streamSessionId)
}

/**
* Convert the object to JSON.
*
* @return string JSON representation of the payload.
*
* @throws JsonException If encoding to JSON fails.
* @throws InvalidPayloadException If payload is not valid.
* @inheritdoc
*/
#[Override]
public function toJson(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetAllSymbolsPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
final class GetAllSymbolsPayload extends AbstractPayload
{
/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetCalendarPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
final class GetCalendarPayload extends AbstractPayload
{
/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetChartLastRequestPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ public function __construct(ChartLastInfoRecord $chartLastInfoRecord)
}

/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetChartRangeRequestPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ public function __construct(ChartRangeInfoRecord $chartRangeInfoRecord)
}

/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetCommissionDefPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ public function __construct(string $symbol, float $volume)
}

/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetCurrentUserDataPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
final class GetCurrentUserDataPayload extends AbstractPayload
{
/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetIbsHistoryPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ public function __construct(DateTime $start, DateTime $end)
}

/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetMarginLevelPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
final class GetMarginLevelPayload extends AbstractPayload
{
/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetMarginTradePayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ public function __construct(string $symbol, float $volume)
}

/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetNewsPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ public function __construct(DateTime $start, DateTime $end)
}

/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetProfitCalculationPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ public function __construct(float $closePrice, Cmd $cmd, float $openPrice, strin
}

/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetServerTimePayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
final class GetServerTimePayload extends AbstractPayload
{
/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetStepRulesPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
final class GetStepRulesPayload extends AbstractPayload
{
/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetSymbolPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ public function __construct(string $symbol)
}

/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetTickPricesPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ public function __construct(Level $level, array $symbols, DateTime $timestamp)
}

/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetTradeRecordsPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ public function __construct(array $orders)
}

/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetTradesHistoryPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ public function __construct(DateTime $start, DateTime $end)
}

/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetTradesPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ public function __construct(bool $openedOnly)
}

/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetTradingHoursPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ public function __construct(array $symbols)
}

/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/GetVersionPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
final class GetVersionPayload extends AbstractPayload
{
/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/LoginPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ public function __construct(int $userId, string $password, ?string $appName = nu
}

/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/LogoutPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
final class LogoutPayload extends AbstractPayload
{
/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/PingPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
final class PingPayload extends AbstractPayload
{
/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/PingStreamPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
final class PingStreamPayload extends AbstractStreamPayload
{
/**
* Returns the command name for the payload.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/TradeTransactionPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ public function __construct(TradeTransInfo $tradeTransInfo)
}

/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Payloads/TradeTransactionStatusPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ public function __construct(public int $order)
}

/**
* Get the command.
*
* @return string Command name.
* @inheritdoc
*/
#[Override]
protected function getCommand(): string
Expand Down
Loading

0 comments on commit f13c259

Please sign in to comment.