summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile23
-rw-r--r--src/value.cpp21
2 files changed, 14 insertions, 30 deletions
diff --git a/src/Makefile b/src/Makefile
deleted file mode 100644
index 64b4eb1..0000000
--- a/src/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-CPP = g++
-RM = rm -f
-PHP_DIR = /usr/include/php5
-CPP_FLAGS = -c -I. -I${PHP_DIR} -I${PHP_DIR}/main -I${PHP_DIR}/ext -I${PHP_DIR}/Zend -I${PHP_DIR}/TSRM -g -std=c++11
-
-LD = g++
-LD_FLAGS = -Wall -shared -O2
-RESULT = libphpcpp.so
-
-SOURCES = $(wildcard *.cpp)
-OBJECTS = $(SOURCES:%.cpp=%.o)
-
-all: ${OBJECTS} ${RESULT}
-
-${RESULT}: ${OBJECTS}
- ${LD} ${LD_FLAGS} -o $@ ${OBJECTS}
-
-clean:
- ${RM} *.obj *~* ${OBJECTS} ${RESULT}
-
-${OBJECTS}:
- ${CPP} ${CPP_FLAGS} -fpic -o $@ ${@:%.o=%.cpp}
-
diff --git a/src/value.cpp b/src/value.cpp
index b43d72f..1bec146 100644
--- a/src/value.cpp
+++ b/src/value.cpp
@@ -329,6 +329,9 @@ Value &Value::operator=(Value &&value)
// the other object is no longer valid
value._val = nullptr;
}
+
+ // done
+ return *this;
}
/**
@@ -1201,13 +1204,17 @@ Value &Value::setType(Type type)
// run the conversion
switch (type) {
- case Type::Null: convert_to_null(_val); break;
- case Type::Numeric: convert_to_long(_val); break;
- case Type::Float: convert_to_double(_val); break;
- case Type::Bool: convert_to_boolean(_val); break;
- case Type::Array: convert_to_array(_val); break;
- case Type::Object: convert_to_object(_val); break;
- case Type::String: convert_to_string(_val); break;
+ case Type::Null: convert_to_null(_val); break;
+ case Type::Numeric: convert_to_long(_val); break;
+ case Type::Float: convert_to_double(_val); break;
+ case Type::Bool: convert_to_boolean(_val); break;
+ case Type::Array: convert_to_array(_val); break;
+ case Type::Object: convert_to_object(_val); break;
+ case Type::String: convert_to_string(_val); break;
+ case Type::Resource: throw Php::Exception("Resource types can not be handled by the PHP-CPP library"); break;
+ case Type::Constant: throw Php::Exception("Constant types can not be assigned to a PHP-CPP library variable"); break;
+ case Type::ConstantArray: throw Php::Exception("Constant types can not be assigned to a PHP-CPP library variable"); break;
+ case Type::Callable: throw Php::Exception("Callable types can not be assigned to a PHP-CPP library variable"); break;
}
// done