Permalink
Browse files

- Bug solved in Dia file generator

  • Loading branch information...
1 parent f565c9d commit f7f17d017e1ffcdd3e3ba09d502a72080833cfd8 @shaggyz committed Aug 12, 2012
Showing with 12 additions and 6 deletions.
  1. +6 −1 README.md
  2. +5 −4 lib/PDDiaFile.inc
  3. +1 −1 lib/PDPHPParser.inc
View
@@ -10,11 +10,16 @@ Requirements:
-------------
- php 5.x
-- Dia (testing on Dia 0.97.2 under debian linux squeeze)
+- Dia (tested on Dia 0.97.2 under debian linux squeeze and OSX 1.7.3)
Usage:
------
<code>chmod +x php-dia</code>
<code>./php-dia source-code-dir [output file name]</code>
+
+Example test:
+-------------
+
+<code>./php-dia lib/</code>
View
@@ -35,7 +35,6 @@ class PDDiaFile{
$this->_addMethods($entity['methods']);
$this->_addProperties($entity['properties']);
-
}
}
@@ -47,7 +46,8 @@ class PDDiaFile{
*/
private function _addProperties($propARR){
- if (!is_array($propARR)){
+ if (!is_array($propARR) || !count($propARR)){
+ $this->_content = str_ireplace('%%PROPERTIES%%', "", $this->_content);
return;
}
@@ -103,7 +103,8 @@ class PDDiaFile{
*/
private function _addMethods($methodsARR){
- if (!is_array($methodsARR)){
+ if (!is_array($methodsARR) || !count($methodsARR)){
+ $this->_content = str_ireplace('%%OPERATIONS%%', "", $this->_content);
return;
}
@@ -121,7 +122,7 @@ class PDDiaFile{
continue;
}
- // Public by default
+ // Default is public
$scope = array_key_exists('scope', $method) ? $method['scope'] : 'public';
View
@@ -47,7 +47,7 @@ class PDPHPParser{
/**
*
- * Find the item "class" in the xml code
+ * Find the "class" item in the xml code
* @param array $codeARR
*/
private function _haveClass($codeARR){

0 comments on commit f7f17d0

Please sign in to comment.