Skip to content

Commit

Permalink
Doc fixes;
Browse files Browse the repository at this point in the history
Added .gitattributes, for the purposes of a lite Composer install.
  • Loading branch information
boenrobot committed Apr 29, 2017
1 parent 25458e8 commit f1e6fe7
Show file tree
Hide file tree
Showing 11 changed files with 266 additions and 188 deletions.
15 changes: 15 additions & 0 deletions .gitattributes
@@ -0,0 +1,15 @@
*.php text eol=lf
/docs export-ignore
/tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.scrutinizer.yml export-ignore
.travis.yml export-ignore
README export-ignore
README.md export-ignore
CREDITS export-ignore
RELEASE-* export-ignore
extrasetup.php export-ignore
package.xml export-ignore
packagexmlsetup.php export-ignore
scanoptions.php export-ignore
16 changes: 15 additions & 1 deletion docs/sami.php
@@ -1,6 +1,20 @@
<?php

/**
* File sami.php for PEAR2_Net_Transmitter.
*
* PHP version 5.3
*
* @category Net
* @package PEAR2_Net_Transmitter
* @author Vasil Rangelov <boen.robot@gmail.com>
* @copyright 2011 Vasil Rangelov
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version GIT: $Id$
* @link http://pear2.php.net/PEAR2_Net_Transmitter
*/

use Sami\Sami;
use Sami\Version\GitVersionCollection;
use Symfony\Component\Finder\Finder;

return new Sami(
Expand Down
2 changes: 1 addition & 1 deletion extrasetup.php
@@ -1,7 +1,7 @@
<?php

/**
* extrasetup.php for PEAR2_Net_Transmitter.
* File extrasetup.php for PEAR2_Net_Transmitter.
*
* PHP version 5.3
*
Expand Down
2 changes: 1 addition & 1 deletion packagexmlsetup.php
@@ -1,7 +1,7 @@
<?php

/**
* packagexmlsetup.php for PEAR2_Net_Transmitter.
* File packagexmlsetup.php for PEAR2_Net_Transmitter.
*
* PHP version 5.3
*
Expand Down
68 changes: 36 additions & 32 deletions src/PEAR2/Net/Transmitter/FilterCollection.php
Expand Up @@ -2,11 +2,11 @@

/**
* ~~summary~~
*
*
* ~~description~~
*
*
* PHP version 5
*
*
* @category Net
* @package PEAR2_Net_Transmitter
* @author Vasil Rangelov <boen.robot@gmail.com>
Expand All @@ -22,9 +22,9 @@

/**
* A filter collection.
*
*
* Represents a collection of stream filters.
*
*
* @category Net
* @package PEAR2_Net_Transmitter
* @author Vasil Rangelov <boen.robot@gmail.com>
Expand All @@ -35,41 +35,45 @@
class FilterCollection implements \SeekableIterator, \Countable
{
/**
* @var array The filter collection itself.
* The filter collection itself.
*
* @var array
*/
protected $filters = array();

/**
* @var int A pointer, as required by SeekableIterator.
* A pointer, as required by SeekableIterator.
*
* @var int
*/
protected $position = 0;

/**
* Appends a filter to the collection
*
*
* @param string $name The name of the filter.
* @param array $params An array of parameters for the filter.
*
*
* @return $this The collection itself.
*/
public function append($name, array $params = array())
{
$this->filters[] = array((string) $name, $params);
return $this;
}

/**
* Inserts the filter before a position.
*
*
* Inserts the specified filter before a filter at a specified position. The
* new filter takes the specified position, while previous filters are moved
* forward by one.
*
*
* @param int $position The position before which the filter will be
* inserted.
* @param string $name The name of the filter.
* @param array $params An array of parameters for the filter.
*
*
* @return $this The collection itself.
*/
public function insertBefore($position, $name, array $params = array())
Expand All @@ -92,12 +96,12 @@ public function insertBefore($position, $name, array $params = array())
);
return $this;
}

/**
* Removes a filter at a specified position.
*
*
* @param int $position The position from which to remove a filter.
*
*
* @return $this The collection itself.
*/
public function removeAt($position)
Expand All @@ -106,10 +110,10 @@ public function removeAt($position)
$this->filters = array_values($this->filters);
return $this;
}

/**
* Clears the collection
*
*
* @return $this The collection itself.
*/
public function clear()
Expand All @@ -120,7 +124,7 @@ public function clear()

/**
* Gets the number of filters in the collection.
*
*
* @return int The number of filters in the collection.
*/
public function count()
Expand All @@ -130,7 +134,7 @@ public function count()

/**
* Resets the pointer to 0.
*
*
* @return bool TRUE if the collection is not empty, FALSE otherwise.
*/
public function rewind()
Expand All @@ -140,20 +144,20 @@ public function rewind()

/**
* Moves the pointer to a specified position.
*
*
* @param int $position The position to move to.
*
*
* @return bool TRUE if the specified position is valid, FALSE otherwise.
*/
public function seek($position)
{
$this->position = $position;
return $this->valid();
}

/**
* Gets the current position.
*
*
* @return int The current position.
*/
public function getCurrentPosition()
Expand All @@ -163,7 +167,7 @@ public function getCurrentPosition()

/**
* Moves the pointer forward by 1.
*
*
* @return bool TRUE if the new position is valid, FALSE otherwise.
*/
public function next()
Expand All @@ -174,7 +178,7 @@ public function next()

/**
* Gets the filter name at the current pointer position.
*
*
* @return string|false The name of the filter at the current position.
*/
public function key()
Expand All @@ -184,7 +188,7 @@ public function key()

/**
* Gets the filter parameters at the current pointer position.
*
*
* @return array|false An array of parameters for the filter at the current
* position, or FALSE if the position is not valid.
*/
Expand All @@ -195,7 +199,7 @@ public function current()

/**
* Moves the pointer backwards by 1.
*
*
* @return bool TRUE if the new position is valid, FALSE otherwise.
*/
public function prev()
Expand All @@ -206,7 +210,7 @@ public function prev()

/**
* Moves the pointer to the last valid position.
*
*
* @return bool TRUE if the collection is not empty, FALSE otherwise.
*/
public function end()
Expand All @@ -217,7 +221,7 @@ public function end()

/**
* Checks if the pointer is still pointing to an existing offset.
*
*
* @return bool TRUE if the pointer is valid, FALSE otherwise.
*/
public function valid()
Expand Down
49 changes: 27 additions & 22 deletions src/PEAR2/Net/Transmitter/NetworkStream.php
Expand Up @@ -2,11 +2,11 @@

/**
* ~~summary~~
*
*
* ~~description~~
*
*
* PHP version 5
*
*
* @category Net
* @package PEAR2_Net_Transmitter
* @author Vasil Rangelov <boen.robot@gmail.com>
Expand All @@ -22,10 +22,10 @@

/**
* A network transmitter.
*
*
* This is a convenience wrapper for network streams. Used to ensure data
* integrity.
*
*
* @category Net
* @package PEAR2_Net_Transmitter
* @author Vasil Rangelov <boen.robot@gmail.com>
Expand Down Expand Up @@ -60,22 +60,27 @@ abstract class NetworkStream extends Stream
* negotiated between 1.0 and 1.2).
*/
const CRYPTO_TLS = 'TLS';

/**
* @var string The type of stream. Can be either "_CLIENT" or "_SERVER".
* Used to complement the encryption type. Must be set by child classes
* for {@link setCrypto()} to work properly.
* The type of stream. Can be either "_CLIENT" or "_SERVER".
*
* Used to complement the encryption type. Must be set by child classes
* for {@link setCrypto()} to work properly.
*
* @var string
*/
protected $streamType = '';

/**
* @var string The current cryptography setting.
* The current cryptography setting.
*
* @var string
*/
protected $crypto = '';

/**
* Wraps around the specified stream.
*
*
* @param resource $stream The stream to wrap around.
*/
public function __construct($stream)
Expand All @@ -85,7 +90,7 @@ public function __construct($stream)

/**
* Gets the current cryptography setting.
*
*
* @return string One of this class' CRYPTO_* constants.
*/
public function getCrypto()
Expand All @@ -95,10 +100,10 @@ public function getCrypto()

/**
* Sets the current connection's cryptography setting.
*
*
* @param string $type The encryption type to set. Must be one of this
* class' CRYPTO_* constants.
*
*
* @return boolean TRUE on success, FALSE on failure.
*/
public function setCrypto($type)
Expand All @@ -121,7 +126,7 @@ public function setCrypto($type)

/**
* Checks whether the stream is available for operations.
*
*
* @return bool TRUE if the stream is available, FALSE otherwise.
*/
public function isAvailable()
Expand All @@ -135,14 +140,14 @@ public function isAvailable()
}
return false;
}

/**
* Sets the size of a stream's buffer.
*
*
* @param int $size The desired size of the buffer, in bytes.
* @param int $direction The buffer of which direction to set. Valid
* values are the DIRECTION_* constants.
*
*
* @return bool TRUE on success, FALSE on failure.
*/
public function setBuffer($size, $direction = self::DIRECTION_ALL)
Expand All @@ -155,15 +160,15 @@ public function setBuffer($size, $direction = self::DIRECTION_ALL)
}
return $result;
}

/**
* Shutdown a full-duplex connection
*
*
* Shutdowns (partially or not) a full-duplex connection.
*
*
* @param int $direction The direction for which to disable further
* communications.
*
*
* @return bool TRUE on success, FALSE on failure.
*/
public function shutdown($direction = self::DIRECTION_ALL)
Expand Down

0 comments on commit f1e6fe7

Please sign in to comment.