Skip to content

Commit

Permalink
code format, phpdocs and dependencies update
Browse files Browse the repository at this point in the history
  • Loading branch information
tufanbarisyildirim committed Dec 5, 2018
1 parent d53b778 commit 21db44e
Show file tree
Hide file tree
Showing 17 changed files with 3,818 additions and 1,773 deletions.
72 changes: 40 additions & 32 deletions composer.json
@@ -1,34 +1,42 @@
{
"name": "tufanbarisyildirim/php-apk-parser",
"type": "library",
"description": "Read basic info about an application from .apk file.",
"keywords": ["apk", "parser", "android"],
"homepage": "https://github.com/tufanbarisyildirim/php-apk-parser",
"license": "MIT",
"authors": [
{
"name": "Tufan Baris YILDIRIM",
"email": "tufanbarisyildirim@gmail.com",
"homepage": "http://tufanbarisyildirim.com",
"role": "Developer"
}
],
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "3.7.*"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/tufanbarisyildirim/php-apk-parser.git"
}
],
"autoload": {
"psr-0": {
"ApkParser": "lib"
}
},
"minimum-stability": "dev"
"name": "tufanbarisyildirim/php-apk-parser",
"type": "library",
"description": "Read basic info about an application from .apk file.",
"keywords": [
"apk",
"parser",
"android"
],
"homepage": "https://github.com/tufanbarisyildirim/php-apk-parser",
"license": "MIT",
"authors": [
{
"name": "Tufan Baris YILDIRIM",
"email": "tufanbarisyildirim@gmail.com",
"homepage": "http://tufanbarisyildirim.com",
"role": "Developer"
}
],
"require": {
"php": ">=5.3.0",
"ext-simplexml": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-mbstring": "*"
},
"require-dev": {
"phpunit/phpunit": "3.7.*"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/tufanbarisyildirim/php-apk-parser.git"
}
],
"autoload": {
"psr-0": {
"ApkParser": "lib"
}
},
"minimum-stability": "dev"
}
4 changes: 2 additions & 2 deletions lib/ApkParser/Application.php
@@ -1,4 +1,5 @@
<?php

namespace ApkParser;

/**
Expand All @@ -9,7 +10,6 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class Application
{
/**
Expand Down Expand Up @@ -54,7 +54,7 @@ public function getLabel()
public function getAttr($attrName)
{
$attr = get_object_vars($this->application);
return (string)$attr['@attributes'][$attrName];
return isset($attr['@attributes']) && isset($attr['@attributes'][$attrName]) ? (string)$attr['@attributes'][$attrName] : null;
}

/**
Expand Down
6 changes: 4 additions & 2 deletions lib/ApkParser/Config.php
Expand Up @@ -7,7 +7,9 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace ApkParser;

/**
* Class Config
* @package ApkParser
Expand All @@ -28,8 +30,8 @@ class Config
public function __construct(array $config = array())
{
$this->config = array_merge(array(
'tmp_path' => sys_get_temp_dir(),
'jar_path' => __DIR__ . '/Dex/dedexer.jar',
'tmp_path' => sys_get_temp_dir(),
'jar_path' => __DIR__ . '/Dex/dedexer.jar',
'manifest_only' => false
), $config);
}
Expand Down
9 changes: 9 additions & 0 deletions lib/ApkParser/Exceptions/ApkException.php
@@ -1,6 +1,15 @@
<?php

namespace ApkParser\Exceptions;

/**
* This file is part of the Apk Parser package.
*
* (c) Tufan Baris Yildirim <tufanbarisyildirim@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
class ApkException extends \Exception
{

Expand Down
9 changes: 9 additions & 0 deletions lib/ApkParser/Exceptions/FileNotFoundException.php
@@ -1,6 +1,15 @@
<?php

namespace ApkParser\Exceptions;

/**
* This file is part of the Apk Parser package.
*
* (c) Tufan Baris Yildirim <tufanbarisyildirim@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
class FileNotFoundException extends ApkException
{

Expand Down
9 changes: 9 additions & 0 deletions lib/ApkParser/Exceptions/StreamNotFoundException.php
@@ -1,6 +1,15 @@
<?php

namespace ApkParser\Exceptions;

/**
* This file is part of the Apk Parser package.
*
* (c) Tufan Baris Yildirim <tufanbarisyildirim@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
class StreamNotFoundException extends ApkException
{

Expand Down
18 changes: 13 additions & 5 deletions lib/ApkParser/Exceptions/XmlParserException.php
@@ -1,19 +1,27 @@
<?php
/**
* Created by mcfedr on 1/15/16 12:04
*/

namespace ApkParser\Exceptions;

use Exception;

/**
* This file is part of the Apk Parser package.
*
* (c) Tufan Baris Yildirim <tufanbarisyildirim@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
class XmlParserException extends ApkException
{
/**
* @var \LibXMLError[]
*/
private $xmlErrors;

/**
* XmlParserException constructor.
* @param $xmlstr
*/
public function __construct($xmlstr)
{
$this->xmlErrors = libxml_get_errors();
Expand All @@ -37,7 +45,7 @@ public function __construct($xmlstr)
*/
private function display_xml_error(\LibXMLError $error, $xml)
{
$return = $xml[$error->line - 1] . "\n";
$return = $xml[$error->line - 1] . "\n";
$return .= str_repeat('-', $error->column) . "^\n";

switch ($error->level) {
Expand Down
2 changes: 1 addition & 1 deletion lib/ApkParser/IntentFilter.php
@@ -1,4 +1,5 @@
<?php

namespace ApkParser;

/**
Expand All @@ -9,7 +10,6 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class IntentFilter
{
public $actions = array();
Expand Down

0 comments on commit 21db44e

Please sign in to comment.