Skip to content

Commit

Permalink
Merge pull request #7 from MarwanAlsoltany/dev
Browse files Browse the repository at this point in the history
Stability fixes and internal changes
  • Loading branch information
MarwanAlsoltany authored Sep 26, 2020
2 parents f689346 + e366c8f commit 3c6d4a4
Show file tree
Hide file tree
Showing 263 changed files with 5,420 additions and 2,962 deletions.
91 changes: 68 additions & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,86 @@
# Changelog

All notable changes to AMQP Agent will be documented in this file.
All notable changes to **AMQP Agent** will be documented in this file.


## [Unreleased]


## [1.0.0] - 2020-06-15
- Initial release.


## [1.0.1] - 2020-06-23
- Fix issue with Logger class
- Fix addtional line breaks when writing to log file.
- Fix issue with Logger class:
- Fix additional line breaks when writing to log file.


## [1.1.0] - 2020-08-10
- Add the possiblity to open multiple connection by a worker
- Update AbstractWorker class
- Add connections array and channels array.
- Add setConnection(), getNewConnection() and setChannel() methods.
- Modify old methods to make use of the newly created methods internally.
- Add new tests to the newly created methods.
- Update methods signature on the corresponding interface (AbstractWorkerInterface)
- Update DocBlocks of other classes to reference the newly created methods.
- Rebuild documentation.
- Add the possibility to open multiple connection by a worker.
- Update `AbstractWorker` class:
- Add connections array and channels array.
- Add `setConnection()`, `getNewConnection()`, and `setChannel()` methods.
- Modify old methods to make use of the newly created methods internally.
- Add new tests to the newly created methods.
- Update methods signature on the corresponding interface (`AbstractWorkerInterface`)
- Update DocBlocks of other classes to reference the newly created methods.
- Rebuild documentation.


## [1.1.1] - 2020-09-14
- Update composer.json
- Pump minimum php-amqplib version.
- Update `composer.json`:
- Pump minimum **php-amqplib** version.
- Downgrade minimum php version.
- Update dev requirements versions to match php version.
- Update branch-alias.
- Update scripts field.
- Add conflict field.
- Fix php < 7.4 type hinting incompatibility
- remove return type "self" from methods signature in all interfaces.
- Fix php-amqplib v2.12.0 deprecations
- Fix references to deprecated properties in php-amqplib v2.12.0.
- Change AbstractWorker arguments method to a static method
- Refactor some internal functionalities in different classes
- Update tests so that they run faster
- Update Travis config
- Rebuild documentation
- Fix **php < 7.4** type hinting incompatibility:
- Remove return type "self" from methods signature in all interfaces.
- Fix **php-amqplib** v2.12.0 deprecations:
- Fix references to deprecated properties in **php-amqplib** v2.12.0.
- Change `AbstractWorker` arguments method to a static method.
- Refactor some internal functionalities in different classes.
- Update tests so that they run faster.
- Update Travis config.
- Rebuild documentation.


## [1.2.0] - 2020-09-26
- Update `composer.json`:
- Add a link for the documentation.
- Add some suggestions.
- Update `dev-autoload` namespace.
- Fix typos and update DocBlocks:
- Fix some typos in DocBlocks and other parts of the codebase.
- Add examples to major classes DocBlocks.
- Add `Utility` class to contain some miscellaneous reusable functions.
- Refactor `Logger` class:
- Internal changes to make use of the `Utility` class.
- Better writing directory guessing when no path is specified.
- Update `AmqpAgentException` class:
- Fix issue of wrong fully-qualified name when casting the class to a string.
- Change default message of `rethrowException` method to a more useful one.
- Add a new parameter to change the wrapping thrown exception class.
- Rename the method `rethrowException` to `rethrow` and add the old name as an alias.
- Add `MagicMethodsExceptionsTrait` to unify error messages of calls to magic methods.
- Add `AbstractParameters` class to simplify working with parameters:
- Add `AmqpAgentParameters` as global class for all parameters.
- Add worker specific parameters class (`AbstractWorkerParameters`, `PublisherParameters`, `ConsumerParameters`).
- Update configuration file (`maks-amqp-agent-config.php`) to make use of the newly created `AmqpAgentParameters` class.
- Refactor workers classes (`AbstractWorker`, `Publisher`, `Consumer`):
- Make use of the newly created `*Parameters` class.
- Make use of the newly created `MagicMethodsExceptionsTrait`.
- Remove `@codeCoverageIgnore` annotations from the workers classes.
- Remove constants from the corresponding (`*Interface`) as they are available now via (`*Parameters`).
- Update the class in different places to make use of the new additions.
- Update `WorkerCommandTrait` to make use of the newly created `AmqpAgentParameters` class.
- Remove protected method `mutateClassConst` from `WorkerMutationTrait` as it is not used anymore (usage replaced with `*Parameters::patchWith()`).
- Update old tests to cover the new changes.
- Update tests
- Add new tests for the newly created classes and functions.
- Update `phpunit.xml.dist` to run the new tests.
- Update namespace across all test classes.
- Remove `*Mock` classes from `*Test` classes and move them to their own namespace.
- Rebuild documentation.
- Update formatting of `CHANGELOG.md`.
35 changes: 20 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
],
"homepage": "https://github.com/MarwanAlsoltany/amqp-agent#readme",
"support": {
"docs": "https://marwanalsoltany.github.io/amqp-agent",
"issues": "https://github.com/MarwanAlsoltany/amqp-agent/issues"
},
"require": {
Expand All @@ -39,6 +40,25 @@
"conflict": {
"php": "7.4.0 - 7.4.1"
},
"suggest": {
"symfony/console": "Symfony console component allows you to create CLI commands. Your console commands can be used for any recurring task, such as cronjobs, imports, or other batch jobs.",
"monolog/monolog": "Monolog sends your logs to files, sockets, inboxes, databases and various web services."
},
"autoload": {
"psr-4": {
"MAKS\\AmqpAgent\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"MAKS\\AmqpAgent\\Tests\\": "tests"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"scripts": {
"sniff": "vendor/bin/phpcs --report=xml --report-file=build/phpcs/index.xml src",
"sniff-global": "phpcs --report=xml --report-file=build/phpcs/index.xml src",
Expand All @@ -57,21 +77,6 @@
"build-prod": "composer run-script --quiet build && echo \"Production build completed!\"",
"build-prod-global": "composer run-script --quiet build-global && echo \"Production build completed! [GLOBAL]\""
},
"autoload": {
"psr-4": {
"MAKS\\AmqpAgent\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"MAKS\\AmqpAgent\\": "tests"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"config": {
"optimize-autoloader": true,
"sort-packages": false,
Expand Down
74 changes: 71 additions & 3 deletions docs/classes.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,59 @@ <h2 id="MAKS_AmqpAgent">\MAKS\AmqpAgent</h2>
</tbody>
</table>
</div>
<div class="container">
<h2 id="MAKS_AmqpAgent_Config">\MAKS\AmqpAgent\Config</h2>
<table class="styled">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th/>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="classes/MAKS_AmqpAgent_Config_AbstractParameters.html">AbstractParameters</a>
</td>
<td>An abstract class that exposes a simple API to work with parameters.</td>
<td class="testresult-PASSED">PASSED</td>
</tr>
<tr>
<td>
<a href="classes/MAKS_AmqpAgent_Config_AbstractWorkerParameters.html">AbstractWorkerParameters</a>
</td>
<td>A subset of AmqpAgentParameters class for the AbstractWorker class.</td>
<td class="testresult-EMPTY">EMPTY
</td>
</tr>
<tr>
<td>
<a href="classes/MAKS_AmqpAgent_Config_AmqpAgentParameters.html">AmqpAgentParameters</a>
</td>
<td>A class that encapsulates all AMQP Agent parameters as constants.</td>
<td class="testresult-EMPTY">EMPTY
</td>
</tr>
<tr>
<td>
<a href="classes/MAKS_AmqpAgent_Config_ConsumerParameters.html">ConsumerParameters</a>
</td>
<td>A subset of AmqpAgentParameters class for the Consumer class.</td>
<td class="testresult-EMPTY">EMPTY
</td>
</tr>
<tr>
<td>
<a href="classes/MAKS_AmqpAgent_Config_PublisherParameters.html">PublisherParameters</a>
</td>
<td>A subset of AmqpAgentParameters class for the Publisher class.</td>
<td class="testresult-EMPTY">EMPTY
</td>
</tr>
</tbody>
</table>
</div>
<div class="container">
<h2 id="MAKS_AmqpAgent_Exception">\MAKS\AmqpAgent\Exception</h2>
<table class="styled">
Expand Down Expand Up @@ -119,6 +172,14 @@ <h2 id="MAKS_AmqpAgent_Exception">\MAKS\AmqpAgent\Exception</h2>
<td class="testresult-EMPTY">EMPTY
</td>
</tr>
<tr>
<td>
<a href="classes/MAKS_AmqpAgent_Exception_ConstantDoesNotExistException.html">ConstantDoesNotExistException</a>
</td>
<td>Constant does not exist exception.</td>
<td class="testresult-EMPTY">EMPTY
</td>
</tr>
<tr>
<td>
<a href="classes/MAKS_AmqpAgent_Exception_MethodDoesNotExistException.html">MethodDoesNotExistException</a>
Expand Down Expand Up @@ -176,14 +237,14 @@ <h2 id="MAKS_AmqpAgent_Helper">\MAKS\AmqpAgent\Helper</h2>
<td>
<a href="classes/MAKS_AmqpAgent_Helper_Logger.html">Logger</a>
</td>
<td>A class to write logs, exposing methods that work statically and on instantiation. This class DOES NOT implement \Psr\Log\LoggerInterface.</td>
<td>A class to write logs, exposing methods that work statically and on instantiation.</td>
<td class="testresult-PASSED">PASSED</td>
</tr>
<tr>
<td>
<a href="classes/MAKS_AmqpAgent_Helper_Serializer.html">Serializer</a>
</td>
<td>A flexible serializer to be used in conjuction with the workers.</td>
<td>A flexible serializer to be used in conjunction with the workers.</td>
<td class="testresult-PASSED">PASSED</td>
</tr>
<tr>
Expand All @@ -193,6 +254,13 @@ <h2 id="MAKS_AmqpAgent_Helper">\MAKS\AmqpAgent\Helper</h2>
<td>An abstract class implementing the fundamental functionality of a singleton.</td>
<td class="testresult-PASSED">PASSED</td>
</tr>
<tr>
<td>
<a href="classes/MAKS_AmqpAgent_Helper_Utility.html">Utility</a>
</td>
<td>A class containing miscellaneous helper functions.</td>
<td class="testresult-PASSED">PASSED</td>
</tr>
</tbody>
</table>
</div>
Expand All @@ -218,7 +286,7 @@ <h2 id="MAKS_AmqpAgent_Worker">\MAKS\AmqpAgent\Worker</h2>
<td>
<a href="classes/MAKS_AmqpAgent_Worker_AbstractWorkerSingleton.html">AbstractWorkerSingleton</a>
</td>
<td>An abstract class implementing mapping functions (proxy functions) to turn a normal worker into a singleton.</td>
<td>An abstract decorator class implementing mapping functions (proxy functions) to turn a normal worker into a singleton.</td>
<td class="testresult-PASSED">PASSED</td>
</tr>
<tr>
Expand Down
6 changes: 3 additions & 3 deletions docs/classes/MAKS_AmqpAgent_Client.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@
<a href="#methods">Methods</a>
</li>
<li>
<a href="../source/Client.php.html#line23">Source</a>
<a href="../source/Client.php.html#line32">Source</a>
</li>
</ul>
</nav>
<section>
<h1 id="introduction"><small>MAKS\AmqpAgent\</small>Client</h1>
<h4>A class returns everything AMQP Agent has to offer. A simple service container so to say.</h4>
<p/>
<p>Example:<br/>```<br/>$config = new Config('path/to/some/config-file.php');<br/>$client = new Client($config);<br/>$publisher = $client-&gt;getPublisher(); // or $client-&gt;get('publisher');<br/>$consumer = $client-&gt;getConsumer(); // or $client-&gt;get('consumer');<br/>```</p>
<ul/>
<h2 id="synopsis">Synopsis</h2>
<div class="synopsis">class Client
Expand Down Expand Up @@ -131,7 +131,7 @@ <h2 id="methods">Methods</h2>
<h4>public</h4>
<ul>
<li id="__construct"><a title="MAKS\AmqpAgent\Client" href="../classes/MAKS_AmqpAgent_Client/__construct.html">__construct()</a>
— Client object constuctor.</li>
— Client object constructor.</li>
<li id="__get"><a title="MAKS\AmqpAgent\Client" href="../classes/MAKS_AmqpAgent_Client/__get.html">__get()</a>
— Gets a class member via public property access notation.</li>
<li id="get"><a title="MAKS\AmqpAgent\Client" href="../classes/MAKS_AmqpAgent_Client/get.html">get()</a>
Expand Down
20 changes: 10 additions & 10 deletions docs/classes/MAKS_AmqpAgent_Client/__construct.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@
<a href="#tests">Tests</a>
</li>
<li>
<a href="../../source/Client.php.html#line61">Source</a>
<a href="../../source/Client.php.html#line70">Source</a>
</li>
</ul>
</nav>
<section>
<h1><small>MAKS\AmqpAgent\Client::</small>__construct</h1>
<h4>Client object constuctor.</h4>
<h4>Client object constructor.</h4>
<p/>
<ul/>
<h2 id="signature">Signature</h2>
Expand Down Expand Up @@ -109,14 +109,14 @@ <h3>Information</h3>
</ul>
<h3>Tests</h3>
<ul class="styled">
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Test\ClientTest::testAmqpAgentExceptionViaConstructorIsRaisedWhenUnSupportedArgumentIsProvided</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Test\ClientTest::testInstantiatingAClientWithAPathToConfigFileAndGetingConfigInstanceBack</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Test\ClientTest::testGetPublisherInstance</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Test\ClientTest::testGetConsumerInstance</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Test\ClientTest::testGetSerializerInstance</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Test\ClientTest::testGetLoggerInstance</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Test\ClientTest::testGetInstanceByName</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Test\ClientTest::testGetInstanceRaisesExceptionIfMemberCouldNotBeFetched</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Tests\ClientTest::testAmqpAgentExceptionViaConstructorIsRaisedWhenUnSupportedArgumentIsProvided</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Tests\ClientTest::testInstantiatingAClientWithAPathToConfigFileAndGetingConfigInstanceBack</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Tests\ClientTest::testGetPublisherInstance</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Tests\ClientTest::testGetConsumerInstance</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Tests\ClientTest::testGetSerializerInstance</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Tests\ClientTest::testGetLoggerInstance</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Tests\ClientTest::testGetInstanceByName</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Tests\ClientTest::testGetInstanceRaisesExceptionIfMemberCouldNotBeFetched</li>
</ul>
</div>
</section>
Expand Down
12 changes: 6 additions & 6 deletions docs/classes/MAKS_AmqpAgent_Client/__get.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<a href="#tests">Tests</a>
</li>
<li>
<a href="../../source/Client.php.html#line79">Source</a>
<a href="../../source/Client.php.html#line88">Source</a>
</li>
</ul>
</nav>
Expand Down Expand Up @@ -105,11 +105,11 @@ <h3>Information</h3>
</ul>
<h3>Tests</h3>
<ul class="styled">
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Test\ClientTest::testGetPublisherInstance</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Test\ClientTest::testGetConsumerInstance</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Test\ClientTest::testGetSerializerInstance</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Test\ClientTest::testGetLoggerInstance</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Test\ClientTest::testGetInstanceByName</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Tests\ClientTest::testGetPublisherInstance</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Tests\ClientTest::testGetConsumerInstance</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Tests\ClientTest::testGetSerializerInstance</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Tests\ClientTest::testGetLoggerInstance</li>
<li>[ <span class="testresult-PASSED">PASSED</span> ] — MAKS\AmqpAgent\Tests\ClientTest::testGetInstanceByName</li>
</ul>
</div>
</section>
Expand Down
Loading

0 comments on commit 3c6d4a4

Please sign in to comment.