Skip to content

Commit

Permalink
Organizing various documents and codes (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
cable8mm committed Mar 9, 2024
1 parent fe816d9 commit eeded88
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 55 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,5 @@ $RECYCLE.BIN/
# End of https://www.toptal.com/developers/gitignore/api/macos,windows,composer,phpstorm,visualstudiocode,phpunit,composer

composer.lock
/cache
/doctum.php
10 changes: 4 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@
}
},
"scripts": {
"test": [
"./vendor/bin/phpunit tests"
],
"lint": [
"./vendor/bin/pint"
]
"test": "./vendor/bin/phpunit tests",
"lint": "./vendor/bin/pint",
"inspect": "./vendor/bin/pint --test",
"apidoc": "doctum.phar update doctum.php --output-format=github --no-ansi --no-progress"
}
}
19 changes: 6 additions & 13 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"
executionOrder="depends,defects"
beStrictAboutCoverageMetadata="true"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true"
cacheResult ="false"
testdox="true"
colors="true">
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
testdox="true">
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>

<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true">
<source>
<include>
<directory>src</directory>
</include>
</source>
</phpunit>
</phpunit>
3 changes: 0 additions & 3 deletions pint.json

This file was deleted.

8 changes: 4 additions & 4 deletions src/Big.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Cable8mm\BigkindsPhpClient;

/**
* Facade class for BigkindsClient to be used conveniently.
*/
class Big
{
/**
* Big::kinds Facade.
*
* @param array $options
* @return array
*/
public static function kinds(string $method, $options = [])
public static function kinds(string $method, array $options = []): array
{
$bigkinds = new BigkindsClient();
$response = $bigkinds->request($method, $options);
Expand Down
26 changes: 4 additions & 22 deletions src/BigkindsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
*/
class BigkindsClient
{
/**
* BigkindsClient library version.
*/
const LIBVER = '0.1.0';

/**
* Test Base Path from Guide.
*
Expand Down Expand Up @@ -69,6 +64,9 @@ class BigkindsClient
'keyword' => 'keyword',
];

/**
* Constructor.
*/
public function __construct(array $config = [], ?\GuzzleHttp\Client $http = null)
{
if (! empty($config)) {
Expand All @@ -84,16 +82,10 @@ public function __construct(array $config = [], ?\GuzzleHttp\Client $http = null
$this->http = $http ?? new \GuzzleHttp\Client(['base_uri' => self::$base_path]);
}

public function with(string $argumentName, $arguments = [])
{
return $this;
}

/**
* @param array $query || nullable
* @return array
*/
public function request(string $method, array $query = [])
public function request(string $method, array $query = []): mixed
{
// guard
if (! array_key_exists($method, self::$methods)) {
Expand Down Expand Up @@ -127,16 +119,6 @@ public function request(string $method, array $query = [])
return json_decode($requestBody, true);
}

/**
* Get a string containing the version of the library.
*
* @return string
*/
public function getLibraryVersion()
{
return self::LIBVER;
}

/**
* Set the Http Client object.
*
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ protected function setUp(): void
$this->bigkindsClient = new BigkindsClient();
}

public function testSampleRequest()
public function test_todo(): void
{
$this->assertEquals($this->bigkindsClient->getLibraryVersion(), '0.1.0');
$this->assertTrue(true);
}
}
5 changes: 0 additions & 5 deletions tests/Unit/BigkindsClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ protected function setUp(): void
$this->bigkindsClient = new BigkindsClient();
}

public function testGetLibraryVersion()
{
$this->assertEquals($this->bigkindsClient->getLibraryVersion(), '0.1.0');
}

public function testCreateBigkindsClient()
{
$this->assertInstanceOf(BigkindsClient::class, $this->bigkindsClient);
Expand Down

0 comments on commit eeded88

Please sign in to comment.