Skip to content

Commit

Permalink
Merge 556c22d into bff03c0
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati committed Mar 30, 2020
2 parents bff03c0 + 556c22d commit d2f5707
Show file tree
Hide file tree
Showing 24 changed files with 170 additions and 105 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: mlocati
custom: "https://paypal.me/mlocati"
40 changes: 33 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ sudo: true

language: php

branches:
only:
- master

env:
- COMPOSER_DISABLE_XDEBUG_WARN=1

php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm

before_script:
- sudo apt-get -qq update
Expand All @@ -24,6 +21,35 @@ script:
- mkdir -p build/logs
- ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml

matrix:
fast_finish: true
allow_failures:
- name: Test with PHP Nightly
include:
- name: Test with PHP 5.3
dist: precise
php: '5.3'
- name: Test with PHP 5.4
dist: trusty
php: '5.4'
- name: Test with PHP 5.5
dist: trusty
php: '5.5'
- name: Test with PHP 5.6
php: '5.6'
- name: Test with PHP 7.0
php: '7.0'
- name: Test with PHP 7.1
php: '7.1'
- name: Test with PHP 7.2
php: '7.2'
- name: Test with PHP 7.3
php: '7.3'
- name: Test with PHP 7.4
php: '7.4'
- name: Test with PHP Nightly
php: nightly

cache:
directories:
- vendor
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,9 @@ $toc->resolve($map);
// Now the TOC of the main CHM file contains references to the entries in the other two CHM files
printTree($toc, 0);
```



## Do you want to really say thank you?

You can offer me a [monthly coffee](https://github.com/sponsors/mlocati) or a [one-time coffee](https://paypal.me/mlocati) :wink:
12 changes: 11 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,15 @@
},
"require": {
"php": ">=5.3.3"
}
},
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/mlocati"
},
{
"type": "other",
"url": "https://www.paypal.me/mlocati"
}
]
}
40 changes: 20 additions & 20 deletions src/CHM.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,58 +16,58 @@ class CHM
/**
* The reader that provides the data.
*
* @var Reader
* @var \CHMLib\Reader\Reader
*/
protected $reader;

/**
* The CHM initial header.
*
* @var Header\ITSF
* @var \CHMLib\Header\ITSF
*/
protected $itsf;

/**
* The directory listing header.
*
* @var Header\ITSP
* @var \CHMLib\Header\ITSP
*/
protected $itsp;

/**
* The entries found in this CHM.
*
* @var Entry[]
* @var \CHMLib\Entry[]
*/
protected $entries;

/**
* The data sections.
*
* @var Section\Section[]
* @var \CHMLib\Section\Section[]
*/
protected $sections;

/**
* The TOC.
*
* @var TOCIndex\Tree|null|false
* @var \CHMLib\TOCIndex\Tree|null|false
*/
protected $toc;

/**
* The index.
*
* @var TOCIndex\Tree|null|false
* @var \CHMLib\TOCIndex\Tree|null|false
*/
protected $index;

/**
* Initializes the instance.
*
* @param Reader $reader The reader that provides the data.
* @param \CHMLib\Reader\Reader $reader The reader that provides the data.
*
* @throws Exception Throws an Exception in case of errors.
* @throws \Exception Throws an Exception in case of errors.
*/
public function __construct(Reader $reader)
{
Expand Down Expand Up @@ -128,7 +128,7 @@ public static function fromFile($filename)
/**
* Get the reader that provides the data.
*
* @return Reader
* @return \CHMLib\Reader\Reader
*/
public function getReader()
{
Expand All @@ -138,7 +138,7 @@ public function getReader()
/**
* Get the CHM initial header.
*
* @return Header\ITSF
* @return \CHMLib\Header\ITSF
*/
public function getITSF()
{
Expand All @@ -148,7 +148,7 @@ public function getITSF()
/**
* Get the directory listing header.
*
* @return Header\ITSP
* @return \CHMLib\Header\ITSP
*/
public function getITSP()
{
Expand All @@ -160,7 +160,7 @@ public function getITSP()
*
* @param string $path The full path (case sensitive) of the entry to look for.
*
* @return Entry|null
* @return \CHMLib\Entry|null
*/
public function getEntryByPath($path)
{
Expand Down Expand Up @@ -192,7 +192,7 @@ public function getEntries($type = null)
*
* @param int $i
*
* @return Section\Section|null
* @return \CHMLib\Section\Section|null
*/
public function getSectionByIndex($i)
{
Expand All @@ -202,9 +202,9 @@ public function getSectionByIndex($i)
/**
* Retrieve the list of the entries contained in this CHM.
*
* @throws Exception Throws an Exception in case of errors.
* @throws \Exception Throws an Exception in case of errors.
*
* @return Entry[]
* @return \CHMLib\Entry[]
*/
protected function retrieveEntryList()
{
Expand All @@ -221,7 +221,7 @@ protected function retrieveEntryList()
throw $x;
}
$this->reader->setPosition($offset);
$pmgi = new Header\PMGI($this->reader);
new Header\PMGI($this->reader);
$pmgl = null;
}
if ($pmgl !== null) {
Expand All @@ -242,7 +242,7 @@ protected function retrieveEntryList()
/**
* Retrieve the list of the data sections contained in this CHM.
*
* @throws Exception Throws an Exception in case of errors.
* @throws \Exception Throws an Exception in case of errors.
*/
protected function retrieveSectionList()
{
Expand Down Expand Up @@ -285,7 +285,7 @@ protected function retrieveSectionList()
/**
* Get the TOC of this CHM file (if available).
*
* @return SpecialEntry\TOC|null
* @return \CHMLib\TOCIndex\Tree|null
*/
public function getTOC()
{
Expand All @@ -306,7 +306,7 @@ public function getTOC()
/**
* Get the index of this CHM file (if available).
*
* @return TOCIndex\Tree|null
* @return \CHMLib\TOCIndex\Tree|null
*/
public function getIndex()
{
Expand Down
8 changes: 4 additions & 4 deletions src/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static function setContentCacheEnabled($enabled)
/**
* The parent CHM file.
*
* @var CHM
* @var \CHMLib\CHM
*/
protected $chm;

Expand Down Expand Up @@ -116,7 +116,7 @@ public static function setContentCacheEnabled($enabled)
/**
* Initializes the instance.
*
* @param CHM $chm The parent CHM file.
* @param \CHMLib\CHM $chm The parent CHM file.
*/
public function __construct(CHM $chm)
{
Expand Down Expand Up @@ -145,7 +145,7 @@ public function __construct(CHM $chm)
/**
* Get the parent CHM file.
*
* @return CHM
* @return \CHMLib\CHM
*/
public function getCHM()
{
Expand Down Expand Up @@ -245,7 +245,7 @@ public function getType()
/**
* Get the contents of this entry.
*
* @throws Exception Throws an Exception in case of errors.
* @throws \Exception Throws an Exception in case of errors.
*
* @return string
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Header/ITSF.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ITSF extends VersionedHeader
/**
* The language of the OS at the time of compilation.
*
* @var Language
* @var \CHMLib\Windows\Language
*/
protected $originalOSLanguage;

Expand Down Expand Up @@ -80,8 +80,8 @@ class ITSF extends VersionedHeader
*
* @param Reader $reader The reader that provides the data.
*
* @throws UnexpectedHeaderException Throws an UnexpectedHeaderException if the header signature is not valid.
* @throws Exception Throws an Exception in case of errors.
* @throws \CHMLib\Exception\UnexpectedHeaderException Throws an UnexpectedHeaderException if the header signature is not valid.
* @throws \Exception Throws an Exception in case of errors.
*/
public function __construct(Reader $reader)
{
Expand Down Expand Up @@ -121,7 +121,7 @@ public function getTimestamp()
/**
* Get the language of the OS at the time of compilation.
*
* @return Language
* @return \CHMLib\Windows\Language
*/
public function getOriginalOSLanguage()
{
Expand Down
8 changes: 4 additions & 4 deletions src/Header/ITSP.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ITSP extends VersionedHeader
/**
* The language of the program that generated the CHM file.
*
* @var Language
* @var \CHMLib\Windows\Language
*/
protected $generatorLanguage;

Expand All @@ -82,8 +82,8 @@ class ITSP extends VersionedHeader
*
* @param Reader $reader The reader that provides the data.
*
* @throws UnexpectedHeaderException Throws an UnexpectedHeaderException if the header signature is not valid.
* @throws Exception Throws an Exception in case of errors.
* @throws \CHMLib\Exception\UnexpectedHeaderException Throws an UnexpectedHeaderException if the header signature is not valid.
* @throws \Exception Throws an Exception in case of errors.
*/
public function __construct(Reader $reader)
{
Expand Down Expand Up @@ -186,7 +186,7 @@ public function getNumberOfDirectoryChunks()
/**
* Get the language of the program that generated the CHM file.
*
* @return Language
* @return \CHMLib\Windows\Language
*/
public function getGeneratorLanguage()
{
Expand Down
6 changes: 3 additions & 3 deletions src/Header/LZXC.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ class LZXC extends Header
/**
* Initializes the instance.
*
* @param Reader $reader The reader that provides the data.
* @param \CHMLib\Reader\Reader $reader The reader that provides the data.
*
* @throws UnexpectedHeaderException Throws an UnexpectedHeaderException if the header signature is not valid.
* @throws Exception Throws an Exception in case of errors.
* @throws \CHMLib\Exception\UnexpectedHeaderException Throws an UnexpectedHeaderException if the header signature is not valid.
* @throws \Exception Throws an Exception in case of errors.
*/
public function __construct(Reader $reader)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Header/PMGI.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class PMGI extends Header
*
* @param Reader $reader The reader that provides the data.
*
* @throws UnexpectedHeaderException Throws an UnexpectedHeaderException if the header signature is not valid.
* @throws Exception Throws an Exception in case of errors.
* @throws \CHMLib\Exception\UnexpectedHeaderException Throws an UnexpectedHeaderException if the header signature is not valid.
* @throws \Exception Throws an Exception in case of errors.
*/
public function __construct(Reader $reader)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Header/PMGL.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ class PMGL extends Header
/**
* Initializes the instance.
*
* @param Reader $reader The reader that provides the data.
* @param \CHMLib\Reader\Reader $reader The reader that provides the data.
*
* @throws UnexpectedHeaderException Throws an UnexpectedHeaderException if the header signature is not valid.
* @throws Exception Throws an Exception in case of errors.
* @throws \CHMLib\Exception\UnexpectedHeaderException Throws an UnexpectedHeaderException if the header signature is not valid.
* @throws \Exception Throws an Exception in case of errors.
*/
public function __construct(Reader $reader)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Header/VersionedHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ abstract class VersionedHeader extends Header
/**
* Initializes the instance.
*
* @param Reader $reader The reader that provides the data.
* @param \CHMLib\Reader\Reader $reader The reader that provides the data.
*
* @throws \Exception Throws an Exception in case of errors.
*/
Expand Down
Loading

0 comments on commit d2f5707

Please sign in to comment.