Commit Graph

49 Commits

Author SHA1 Message Date
73899ce987 Moved document parsing logic to DocumentParser 2018-12-27 09:36:42 +03:00
d8eaf093da Update test according to incoming usage 2018-12-27 08:44:11 +03:00
9b723a4c42 Extract data related testing logic to a TestCase
This is obviously for cleaner tests and reusability
2018-12-26 08:45:06 +03:00
7bbf744a76 Removed Microdata class and its test
This is related with incoming changes in future commits.
2018-12-26 08:36:03 +03:00
d2f6572125 Added a test for itemid and content attributes 2018-12-18 11:29:31 +03:00
f763ad5b56 Added a test for absoluteUriHandler 2018-12-18 10:07:15 +03:00
7e7fe217a2 Added null type to docblock 2018-12-18 10:00:58 +03:00
9c46cada85 Clarified Readme [ci skip] 2018-12-17 20:48:14 +03:00
dcd54585cc Make handling of absolute uris changable through a callback 2018-12-17 20:15:13 +03:00
a4a5cce8d8 Refactored long switch case with duplicate code to lookup table
This is more performant(can be ignored but an extra) due to nature of lookup tables. Also it is more compact and has ease of extension. It is a little bit scary at the first sight though.
2018-12-17 19:20:18 +03:00
d317ebdfb7 Remove registering of DOMDocument
As stated in documentation of DOMDocument, registering DOMDocument is unnecessary.

Source: https://secure.php.net/manual/en/domdocument.registernodeclass.php#example-6650
2018-12-17 17:35:48 +03:00
e26f84fd0c Refactoring by extracting a method 2018-12-16 12:23:09 +03:00
1ce3f5fd17 Added references to W3C Specification in docblocks
This is much better for understanding whats going on. Also as the reference links are pointing to 26/04/2018 version, it helps understanding if things have been changed etc.
2018-12-14 10:05:33 +03:00
9eaf3cbcfa Docblocking and type hinting 2018-12-13 09:50:04 +03:00
59d302176d Update .travis.yml
Removed 7.0 from ignoring list because code coverage can be generated for PHP 7.0.
2018-11-15 09:17:23 +03:00
f4993272e8 Update .travis.yml 2018-11-15 09:07:13 +03:00
405725977d Update composer.json 2018-11-15 08:51:48 +03:00
1062a5130d Remove HHVM from .travis.yml
HHVM fails with array destructuring which phpunit uses. The problem here is Travis flags build as errored because of this.
2018-11-14 23:26:53 +03:00
679111fc88 Remove php5.6 from .travis.yml 2018-11-14 23:20:51 +03:00
3e44b1a50d Correct the JSON formatting in README 2018-11-14 23:15:59 +03:00
9d82d8c343 :) 2018-11-14 23:10:01 +03:00
5c694a7e4c Added test data for <object> and <data> tags 2018-11-13 19:54:01 +03:00
c87b49408a Updated usage section in README 2018-11-12 20:30:19 +03:00
c3eba31d40 Fixed LibXML errors are not suppressed 2018-11-12 19:41:45 +03:00
b5377c04c5 Changed test names with more reasonable ones
These names helps understand purpose of the tests. Also --testdox-html option of phpunit generates more logical results that way.
2018-11-12 19:23:35 +03:00
a5bfeb5ec5 Added itemref support and test
The test also tests "src based tags" as can be seen in dataset name
2018-11-12 19:11:52 +03:00
e17ceac9ea Added MicrodataDOMDocument
This is for both gaining flexibility and made code cleaner.
2018-11-12 18:05:31 +03:00
daa8efa0fa Added Microdata class and test
Microdata class allows creating MicrodataParser from different sources.
2018-11-12 15:25:04 +03:00
7c3700e8cf Style fix 2018-11-12 11:31:45 +03:00
2225011252 Added tests for output methods 2018-11-12 11:30:42 +03:00
d769253701 Added different output methods 2018-11-12 11:20:01 +03:00
5923db266c Formatting 2018-11-11 23:19:53 +03:00
ee7eaf1317 Some refactoring 2018-11-11 23:18:13 +03:00
87dd20f753 Changed \DOMElement typehints to MicrodataDOMElement 2018-11-11 23:07:44 +03:00
da88066237 Added ext-dom as dependency
ext-dom is required for DOMDocument, DOMElement etc. which is base of this package.
2018-11-11 23:04:19 +03:00
9de66c3b40 Added no break comments
This is for both PSR-2 and avoiding pitfalls(that is why it is in PSR-2).
2018-11-11 22:59:59 +03:00
9dd85c1e5b Some formatting 2018-11-11 22:55:36 +03:00
7bba0cbaa6 Little formatting 2018-11-11 22:54:43 +03:00
89dfec9e39 Small fix 2018-11-11 22:49:31 +03:00
4cdd720082 Refactoring 2018-11-11 22:47:37 +03:00
faeb1f97a0 Some refactoring 2018-11-11 21:53:08 +03:00
65f35e747b Removed comments that only shows steps
This steps was only helpful while implementing the algorithm. And could be useful while comparing with the W3C specification, but they take up too much space.
2018-11-11 21:00:12 +03:00
793d596541 Changed array_map to foreach
Unfortunately array_map only accepts arrays. Foreach looks more understandable (and performant) this way.
2018-11-11 20:54:31 +03:00
0e2f17ac37 Extracted methods to a class 2018-11-11 20:49:54 +03:00
dbfce2ae54 Added a test and a test data 2018-11-11 14:35:59 +03:00
8d8503661f Added package skeleton
Added modified version of thephpleague/skeleton as skeleton of package.
2018-11-10 21:57:03 +03:00
b3edcd23a4 Removed procedural implementation 2018-11-10 15:11:39 +03:00
880d3d8346 Same functionality implemented in OOP 2018-11-10 15:06:43 +03:00
d76e764496 Initial commit
Procedural implemantation of W3C Microdata Specification
2018-11-10 13:51:55 +03:00